@@ -13,7 +13,7 @@ use rustc::mir::{
13
13
use rustc:: mir:: visit:: {
14
14
Visitor , PlaceContext , MutatingUseContext , MutVisitor , NonMutatingUseContext ,
15
15
} ;
16
- use rustc:: mir:: interpret:: { InterpError :: Panic , Scalar , GlobalId , InterpResult , PanicMessage } ;
16
+ use rustc:: mir:: interpret:: { Scalar , GlobalId , InterpResult , InterpError , PanicMessage } ;
17
17
use rustc:: ty:: { self , Instance , ParamEnv , Ty , TyCtxt } ;
18
18
use syntax_pos:: { Span , DUMMY_SP } ;
19
19
use rustc:: ty:: subst:: InternalSubsts ;
@@ -314,8 +314,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
314
314
| HeapAllocNonPowerOfTwoAlignment ( _)
315
315
| Unreachable
316
316
| ReadFromReturnPointer
317
- | GeneratorResumedAfterReturn
318
- | GeneratorResumedAfterPanic
319
317
| ReferencedConstant
320
318
| InfiniteLoop
321
319
=> {
@@ -595,7 +593,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
595
593
)
596
594
} else {
597
595
if overflow {
598
- let err = Panic ( PanicMessage :: Overflow ( op) ) . into ( ) ;
596
+ let err = InterpError :: Panic ( PanicMessage :: Overflow ( op) ) . into ( ) ;
599
597
let _: Option < ( ) > = self . use_ecx ( source_info, |_| Err ( err) ) ;
600
598
return None ;
601
599
}
@@ -809,7 +807,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
809
807
self . super_terminator ( terminator, location) ;
810
808
let source_info = terminator. source_info ;
811
809
match & mut terminator. kind {
812
- TerminatorKind :: Assert { expected, msg, ref mut cond, .. } => {
810
+ TerminatorKind :: Assert { expected, ref msg, ref mut cond, .. } => {
813
811
if let Some ( value) = self . eval_operand ( & cond, source_info) {
814
812
trace ! ( "assertion on {:?} should be {:?}" , value, expected) ;
815
813
let expected = ScalarMaybeUndef :: from ( Scalar :: from_bool ( * expected) ) ;
@@ -831,13 +829,13 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
831
829
. hir ( )
832
830
. as_local_hir_id ( self . source . def_id ( ) )
833
831
. expect ( "some part of a failing const eval must be local" ) ;
834
- use rustc:: mir:: interpret:: InterpError :: * ;
835
832
let msg = match msg {
836
- Panic ( PanicMessage :: Overflow ( _) ) |
837
- Panic ( PanicMessage :: OverflowNeg ) |
838
- Panic ( PanicMessage :: DivisionByZero ) |
839
- Panic ( PanicMessage :: RemainderByZero ) => msg. description ( ) . to_owned ( ) ,
840
- Panic ( PanicMessage :: BoundsCheck { ref len, ref index } ) => {
833
+ PanicMessage :: Overflow ( _) |
834
+ PanicMessage :: OverflowNeg |
835
+ PanicMessage :: DivisionByZero |
836
+ PanicMessage :: RemainderByZero =>
837
+ msg. description ( ) . to_owned ( ) ,
838
+ PanicMessage :: BoundsCheck { ref len, ref index } => {
841
839
let len = self
842
840
. eval_operand ( len, source_info)
843
841
. expect ( "len must be const" ) ;
0 commit comments