@@ -9,8 +9,8 @@ use rustc::mir::visit::{
9
9
MutVisitor , MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor ,
10
10
} ;
11
11
use 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 ,
14
14
SourceInfo , SourceScope , SourceScopeData , Statement , StatementKind , Terminator , TerminatorKind ,
15
15
UnOp , RETURN_PLACE ,
16
16
} ;
@@ -501,7 +501,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
501
501
}
502
502
}
503
503
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 < ( ) > {
505
505
// Somewhat convoluted way to re-use the CTFE error reporting code.
506
506
let lint_root = self . lint_root ( source_info) ?;
507
507
let error = InterpError :: MachineStop ( Box :: new ( format ! ( "{:?}" , panic) ) ) ;
@@ -530,7 +530,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
530
530
// `AssertKind` only has an `OverflowNeg` variant, to make sure that is
531
531
// appropriate to use.
532
532
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 ) ?;
534
534
}
535
535
536
536
Some ( ( ) )
@@ -572,7 +572,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
572
572
let ( _res, overflow, _ty) = this. ecx . overflowing_binary_op ( op, l, r) ?;
573
573
Ok ( overflow)
574
574
} ) ? {
575
- self . report_panic_as_lint ( source_info, PanicInfo :: Overflow ( op) ) ?;
575
+ self . report_panic_as_lint ( source_info, AssertKind :: Overflow ( op) ) ?;
576
576
}
577
577
578
578
Some ( ( ) )
@@ -910,11 +910,11 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
910
910
span,
911
911
|lint| {
912
912
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 } => {
918
918
let len = self
919
919
. eval_operand ( len, source_info)
920
920
. expect ( "len must be const" ) ;
0 commit comments