@@ -26,8 +26,8 @@ use rustc_index::bit_set::ChunkedBitSet;
2626use rustc_index:: vec:: IndexVec ;
2727use rustc_infer:: infer:: { DefiningAnchor , InferCtxt , TyCtxtInferExt } ;
2828use rustc_middle:: mir:: {
29- traversal, Body , ClearCrossCrate , Local , Location , Mutability , Operand , Place , PlaceElem ,
30- PlaceRef , VarDebugInfoContents ,
29+ traversal, Body , ClearCrossCrate , Local , Location , Mutability , NonDivergingIntrinsic , Operand ,
30+ Place , PlaceElem , PlaceRef , VarDebugInfoContents ,
3131} ;
3232use rustc_middle:: mir:: { AggregateKind , BasicBlock , BorrowCheckResult , BorrowKind } ;
3333use rustc_middle:: mir:: { Field , ProjectionElem , Promoted , Rvalue , Statement , StatementKind } ;
@@ -591,22 +591,19 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
591591 flow_state,
592592 ) ;
593593 }
594- StatementKind :: CopyNonOverlapping ( box rustc_middle:: mir:: CopyNonOverlapping {
595- ..
596- } ) => {
597- span_bug ! (
594+ StatementKind :: Intrinsic ( box ref kind) => match kind {
595+ NonDivergingIntrinsic :: Assume ( op) => self . consume_operand ( location, ( op, span) , flow_state) ,
596+ NonDivergingIntrinsic :: CopyNonOverlapping ( ..) => span_bug ! (
598597 span,
599598 "Unexpected CopyNonOverlapping, should only appear after lower_intrinsics" ,
600599 )
601600 }
602- StatementKind :: Nop
601+ // Only relevant for mir typeck
602+ StatementKind :: AscribeUserType ( ..)
603+ // Doesn't have any language semantics
603604 | StatementKind :: Coverage ( ..)
604- | StatementKind :: AscribeUserType ( ..)
605- | StatementKind :: Retag { .. }
606- | StatementKind :: StorageLive ( ..) => {
607- // `Nop`, `AscribeUserType`, `Retag`, and `StorageLive` are irrelevant
608- // to borrow check.
609- }
605+ // Does not actually affect borrowck
606+ | StatementKind :: StorageLive ( ..) => { }
610607 StatementKind :: StorageDead ( local) => {
611608 self . access_place (
612609 location,
@@ -616,7 +613,10 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
616613 flow_state,
617614 ) ;
618615 }
619- StatementKind :: Deinit ( ..) | StatementKind :: SetDiscriminant { .. } => {
616+ StatementKind :: Nop
617+ | StatementKind :: Retag { .. }
618+ | StatementKind :: Deinit ( ..)
619+ | StatementKind :: SetDiscriminant { .. } => {
620620 bug ! ( "Statement not allowed in this MIR phase" )
621621 }
622622 }
0 commit comments