@@ -23,7 +23,6 @@ use rustc::hir;
2323use rustc:: hir:: def_id:: LocalDefId ;
2424use rustc:: mir:: { BorrowKind } ;
2525use syntax_pos:: Span ;
26- use syntax:: errors:: Applicability ;
2726
2827impl < ' tcx > Mirror < ' tcx > for & ' tcx hir:: Expr {
2928 type Output = Expr < ' tcx > ;
@@ -373,37 +372,21 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
373372 // FIXME(eddyb) use logical ops in constants when
374373 // they can handle that kind of control-flow.
375374 ( hir:: BinOpKind :: And , hir:: Constness :: Const ) => {
376- cx. control_flow_destroyed = true ;
377- cx. tcx . sess . struct_span_warn (
375+ cx. control_flow_destroyed . push ( (
378376 op. span ,
379- "boolean short circuiting operators in constants do \
380- not actually short circuit. Thus new const eval features \
381- are not accessible in constants."
382- ) . span_suggestion_with_applicability (
383- op. span ,
384- "use a bit operator instead" ,
385- "&" . into ( ) ,
386- Applicability :: MachineApplicable ,
387- ) . emit ( ) ;
377+ "`&&` operator" . into ( ) ,
378+ ) ) ;
388379 ExprKind :: Binary {
389380 op : BinOp :: BitAnd ,
390381 lhs : lhs. to_ref ( ) ,
391382 rhs : rhs. to_ref ( ) ,
392383 }
393384 }
394385 ( hir:: BinOpKind :: Or , hir:: Constness :: Const ) => {
395- cx. control_flow_destroyed = true ;
396- cx. tcx . sess . struct_span_warn (
397- op. span ,
398- "boolean short circuiting operators in constants do \
399- not actually short circuit. Thus new const eval features \
400- are not accessible in constants."
401- ) . span_suggestion_with_applicability (
386+ cx. control_flow_destroyed . push ( (
402387 op. span ,
403- "use a bit operator instead" ,
404- "|" . into ( ) ,
405- Applicability :: MachineApplicable ,
406- ) . emit ( ) ;
388+ "`||` operator" . into ( ) ,
389+ ) ) ;
407390 ExprKind :: Binary {
408391 op : BinOp :: BitOr ,
409392 lhs : lhs. to_ref ( ) ,
0 commit comments