@@ -9,8 +9,8 @@ use rustc::mir::visit::{
99 MutVisitor , MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor ,
1010} ;
1111use rustc:: mir:: {
12- read_only, AggregateKind , BasicBlock , BinOp , Body , BodyAndCache , ClearCrossCrate , Constant ,
13- Local , LocalDecl , LocalKind , Location , Operand , PanicInfo , Place , ReadOnlyBodyAndCache , Rvalue ,
12+ read_only, AggregateKind , AssertKind , BasicBlock , BinOp , Body , BodyAndCache , ClearCrossCrate ,
13+ Constant , Local , LocalDecl , LocalKind , Location , Operand , Place , ReadOnlyBodyAndCache , Rvalue ,
1414 SourceInfo , SourceScope , SourceScopeData , Statement , StatementKind , Terminator , TerminatorKind ,
1515 UnOp , RETURN_PLACE ,
1616} ;
@@ -501,7 +501,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
501501 }
502502 }
503503
504- fn report_panic_as_lint ( & self , source_info : SourceInfo , panic : PanicInfo < u64 > ) -> Option < ( ) > {
504+ fn report_panic_as_lint ( & self , source_info : SourceInfo , panic : AssertKind < u64 > ) -> Option < ( ) > {
505505 // Somewhat convoluted way to re-use the CTFE error reporting code.
506506 let lint_root = self . lint_root ( source_info) ?;
507507 let error = InterpError :: MachineStop ( Box :: new ( format ! ( "{:?}" , panic) ) ) ;
@@ -530,7 +530,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
530530 // `AssertKind` only has an `OverflowNeg` variant, to make sure that is
531531 // appropriate to use.
532532 assert_eq ! ( op, UnOp :: Neg , "Neg is the only UnOp that can overflow" ) ;
533- self . report_panic_as_lint ( source_info, PanicInfo :: OverflowNeg ) ?;
533+ self . report_panic_as_lint ( source_info, AssertKind :: OverflowNeg ) ?;
534534 }
535535
536536 Some ( ( ) )
@@ -572,7 +572,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
572572 let ( _res, overflow, _ty) = this. ecx . overflowing_binary_op ( op, l, r) ?;
573573 Ok ( overflow)
574574 } ) ? {
575- self . report_panic_as_lint ( source_info, PanicInfo :: Overflow ( op) ) ?;
575+ self . report_panic_as_lint ( source_info, AssertKind :: Overflow ( op) ) ?;
576576 }
577577
578578 Some ( ( ) )
@@ -910,11 +910,11 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
910910 span,
911911 |lint| {
912912 let msg = match msg {
913- PanicInfo :: Overflow ( _)
914- | PanicInfo :: OverflowNeg
915- | PanicInfo :: DivisionByZero
916- | PanicInfo :: RemainderByZero => msg. description ( ) . to_owned ( ) ,
917- PanicInfo :: BoundsCheck { ref len, ref index } => {
913+ AssertKind :: Overflow ( _)
914+ | AssertKind :: OverflowNeg
915+ | AssertKind :: DivisionByZero
916+ | AssertKind :: RemainderByZero => msg. description ( ) . to_owned ( ) ,
917+ AssertKind :: BoundsCheck { ref len, ref index } => {
918918 let len = self
919919 . eval_operand ( len, source_info)
920920 . expect ( "len must be const" ) ;
0 commit comments