@@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
55use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
66use rustc_macros:: HashStable ;
77use rustc_middle:: bug;
8- use rustc_middle:: ty:: { ParamEnv , PolyExistentialTraitRef , Ty , TyCtxt } ;
8+ use rustc_middle:: ty:: { self , PolyExistentialTraitRef , Ty , TyCtxt } ;
99use rustc_target:: abi:: { Align , Size , VariantIdx } ;
1010
1111use super :: { SmallVec , UNKNOWN_LINE_NUMBER , unknown_file_metadata} ;
@@ -49,12 +49,15 @@ pub(super) enum UniqueTypeId<'tcx> {
4949
5050impl < ' tcx > UniqueTypeId < ' tcx > {
5151 pub ( crate ) fn for_ty ( tcx : TyCtxt < ' tcx > , t : Ty < ' tcx > ) -> Self {
52- assert_eq ! ( t, tcx. normalize_erasing_regions( ParamEnv :: reveal_all ( ) , t) ) ;
52+ assert_eq ! ( t, tcx. normalize_erasing_regions( ty :: TypingEnv :: fully_monomorphized ( ) , t) ) ;
5353 UniqueTypeId :: Ty ( t, private:: HiddenZst )
5454 }
5555
5656 pub ( crate ) fn for_enum_variant_part ( tcx : TyCtxt < ' tcx > , enum_ty : Ty < ' tcx > ) -> Self {
57- assert_eq ! ( enum_ty, tcx. normalize_erasing_regions( ParamEnv :: reveal_all( ) , enum_ty) ) ;
57+ assert_eq ! (
58+ enum_ty,
59+ tcx. normalize_erasing_regions( ty:: TypingEnv :: fully_monomorphized( ) , enum_ty)
60+ ) ;
5861 UniqueTypeId :: VariantPart ( enum_ty, private:: HiddenZst )
5962 }
6063
@@ -63,7 +66,10 @@ impl<'tcx> UniqueTypeId<'tcx> {
6366 enum_ty : Ty < ' tcx > ,
6467 variant_idx : VariantIdx ,
6568 ) -> Self {
66- assert_eq ! ( enum_ty, tcx. normalize_erasing_regions( ParamEnv :: reveal_all( ) , enum_ty) ) ;
69+ assert_eq ! (
70+ enum_ty,
71+ tcx. normalize_erasing_regions( ty:: TypingEnv :: fully_monomorphized( ) , enum_ty)
72+ ) ;
6773 UniqueTypeId :: VariantStructType ( enum_ty, variant_idx, private:: HiddenZst )
6874 }
6975
@@ -72,7 +78,10 @@ impl<'tcx> UniqueTypeId<'tcx> {
7278 enum_ty : Ty < ' tcx > ,
7379 variant_idx : VariantIdx ,
7480 ) -> Self {
75- assert_eq ! ( enum_ty, tcx. normalize_erasing_regions( ParamEnv :: reveal_all( ) , enum_ty) ) ;
81+ assert_eq ! (
82+ enum_ty,
83+ tcx. normalize_erasing_regions( ty:: TypingEnv :: fully_monomorphized( ) , enum_ty)
84+ ) ;
7685 UniqueTypeId :: VariantStructTypeCppLikeWrapper ( enum_ty, variant_idx, private:: HiddenZst )
7786 }
7887
@@ -81,10 +90,13 @@ impl<'tcx> UniqueTypeId<'tcx> {
8190 self_type : Ty < ' tcx > ,
8291 implemented_trait : Option < PolyExistentialTraitRef < ' tcx > > ,
8392 ) -> Self {
84- assert_eq ! ( self_type, tcx. normalize_erasing_regions( ParamEnv :: reveal_all( ) , self_type) ) ;
93+ assert_eq ! (
94+ self_type,
95+ tcx. normalize_erasing_regions( ty:: TypingEnv :: fully_monomorphized( ) , self_type)
96+ ) ;
8597 assert_eq ! (
8698 implemented_trait,
87- tcx. normalize_erasing_regions( ParamEnv :: reveal_all ( ) , implemented_trait)
99+ tcx. normalize_erasing_regions( ty :: TypingEnv :: fully_monomorphized ( ) , implemented_trait)
88100 ) ;
89101 UniqueTypeId :: VTableTy ( self_type, implemented_trait, private:: HiddenZst )
90102 }
0 commit comments