@@ -9,8 +9,8 @@ use rustc_middle::mir::visit::{PlaceContext, Visitor};
9
9
use rustc_middle:: mir:: {
10
10
traversal, AggregateKind , BasicBlock , BinOp , Body , BorrowKind , CastKind , CopyNonOverlapping ,
11
11
Local , Location , MirPass , MirPhase , NonDivergingIntrinsic , Operand , Place , PlaceElem , PlaceRef ,
12
- ProjectionElem , RuntimePhase , Rvalue , SourceScope , Statement , StatementKind , Terminator ,
13
- TerminatorKind , UnOp , START_BLOCK ,
12
+ ProjectionElem , RetagKind , RuntimePhase , Rvalue , SourceScope , Statement , StatementKind ,
13
+ Terminator , TerminatorKind , UnOp , START_BLOCK ,
14
14
} ;
15
15
use rustc_middle:: ty:: { self , InstanceDef , ParamEnv , Ty , TyCtxt , TypeVisitable } ;
16
16
use rustc_mir_dataflow:: impls:: MaybeStorageLive ;
@@ -667,10 +667,13 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
667
667
self . fail ( location, "`Deinit`is not allowed until deaggregation" ) ;
668
668
}
669
669
}
670
- StatementKind :: Retag ( _ , _) => {
670
+ StatementKind :: Retag ( kind , _) => {
671
671
// FIXME(JakobDegen) The validator should check that `self.mir_phase <
672
672
// DropsLowered`. However, this causes ICEs with generation of drop shims, which
673
673
// seem to fail to set their `MirPhase` correctly.
674
+ if * kind == RetagKind :: Raw {
675
+ self . fail ( location, "explicit `RetagKind::Raw` is forbidden" ) ;
676
+ }
674
677
}
675
678
StatementKind :: StorageLive ( ..)
676
679
| StatementKind :: StorageDead ( ..)
0 commit comments