@@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
5
5
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
6
6
use rustc_macros:: HashStable ;
7
7
use rustc_middle:: bug;
8
- use rustc_middle:: ty:: { ParamEnv , PolyExistentialTraitRef , Ty , TyCtxt } ;
8
+ use rustc_middle:: ty:: { self , PolyExistentialTraitRef , Ty , TyCtxt } ;
9
9
use rustc_target:: abi:: { Align , Size , VariantIdx } ;
10
10
11
11
use super :: { SmallVec , UNKNOWN_LINE_NUMBER , unknown_file_metadata} ;
@@ -49,12 +49,15 @@ pub(super) enum UniqueTypeId<'tcx> {
49
49
50
50
impl < ' tcx > UniqueTypeId < ' tcx > {
51
51
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) ) ;
53
53
UniqueTypeId :: Ty ( t, private:: HiddenZst )
54
54
}
55
55
56
56
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
+ ) ;
58
61
UniqueTypeId :: VariantPart ( enum_ty, private:: HiddenZst )
59
62
}
60
63
@@ -63,7 +66,10 @@ impl<'tcx> UniqueTypeId<'tcx> {
63
66
enum_ty : Ty < ' tcx > ,
64
67
variant_idx : VariantIdx ,
65
68
) -> 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
+ ) ;
67
73
UniqueTypeId :: VariantStructType ( enum_ty, variant_idx, private:: HiddenZst )
68
74
}
69
75
@@ -72,7 +78,10 @@ impl<'tcx> UniqueTypeId<'tcx> {
72
78
enum_ty : Ty < ' tcx > ,
73
79
variant_idx : VariantIdx ,
74
80
) -> 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
+ ) ;
76
85
UniqueTypeId :: VariantStructTypeCppLikeWrapper ( enum_ty, variant_idx, private:: HiddenZst )
77
86
}
78
87
@@ -81,10 +90,13 @@ impl<'tcx> UniqueTypeId<'tcx> {
81
90
self_type : Ty < ' tcx > ,
82
91
implemented_trait : Option < PolyExistentialTraitRef < ' tcx > > ,
83
92
) -> 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
+ ) ;
85
97
assert_eq ! (
86
98
implemented_trait,
87
- tcx. normalize_erasing_regions( ParamEnv :: reveal_all ( ) , implemented_trait)
99
+ tcx. normalize_erasing_regions( ty :: TypingEnv :: fully_monomorphized ( ) , implemented_trait)
88
100
) ;
89
101
UniqueTypeId :: VTableTy ( self_type, implemented_trait, private:: HiddenZst )
90
102
}
0 commit comments