@@ -13,7 +13,7 @@ use rustc_infer::infer::TyCtxtInferExt;
1313use rustc_middle:: mir:: interpret:: { CTFE_ALLOC_SALT , read_target_uint, write_target_uint} ;
1414use rustc_middle:: mir:: { self , BinOp , ConstValue , NonDivergingIntrinsic } ;
1515use rustc_middle:: ty:: layout:: TyAndLayout ;
16- use rustc_middle:: ty:: { FloatTy , PolyExistentialPredicate , Ty , TyCtxt } ;
16+ use rustc_middle:: ty:: { FloatTy , PolyExistentialPredicate , Ty , TyCtxt , TypeVisitableExt } ;
1717use rustc_middle:: { bug, span_bug, ty} ;
1818use rustc_span:: { Symbol , sym} ;
1919use rustc_trait_selection:: traits:: { Obligation , ObligationCause , ObligationCtxt } ;
@@ -73,6 +73,11 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
7373 ty : Ty < ' tcx > ,
7474 dest : & impl Writeable < ' tcx , M :: Provenance > ,
7575 ) -> InterpResult < ' tcx , ( ) > {
76+ debug_assert ! (
77+ !ty. has_erasable_regions( ) ,
78+ "type {ty:?} has regions that need erasing before writing a TypeId" ,
79+ ) ;
80+
7681 let tcx = self . tcx ;
7782 let type_id_hash = tcx. type_id_hash ( ty) . as_u128 ( ) ;
7883 let op = self . const_val_to_op (
0 commit comments