@@ -26,8 +26,8 @@ use rustc_index::bit_set::ChunkedBitSet;
26
26
use rustc_index:: vec:: IndexVec ;
27
27
use rustc_infer:: infer:: { DefiningAnchor , InferCtxt , TyCtxtInferExt } ;
28
28
use 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 ,
31
31
} ;
32
32
use rustc_middle:: mir:: { AggregateKind , BasicBlock , BorrowCheckResult , BorrowKind } ;
33
33
use rustc_middle:: mir:: { Field , ProjectionElem , Promoted , Rvalue , Statement , StatementKind } ;
@@ -591,22 +591,19 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
591
591
flow_state,
592
592
) ;
593
593
}
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 ! (
598
597
span,
599
598
"Unexpected CopyNonOverlapping, should only appear after lower_intrinsics" ,
600
599
)
601
600
}
602
- StatementKind :: Nop
601
+ // Only relevant for mir typeck
602
+ StatementKind :: AscribeUserType ( ..)
603
+ // Doesn't have any language semantics
603
604
| 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 ( ..) => { }
610
607
StatementKind :: StorageDead ( local) => {
611
608
self . access_place (
612
609
location,
@@ -616,7 +613,10 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
616
613
flow_state,
617
614
) ;
618
615
}
619
- StatementKind :: Deinit ( ..) | StatementKind :: SetDiscriminant { .. } => {
616
+ StatementKind :: Nop
617
+ | StatementKind :: Retag { .. }
618
+ | StatementKind :: Deinit ( ..)
619
+ | StatementKind :: SetDiscriminant { .. } => {
620
620
bug ! ( "Statement not allowed in this MIR phase" )
621
621
}
622
622
}
0 commit comments