@@ -123,15 +123,19 @@ impl<'tcx> InferCtxt<'tcx> {
123
123
/// flow of the inferencer. The key point is that it is
124
124
/// invoked after all type-inference variables have been bound --
125
125
/// right before lexical region resolution.
126
- #[ instrument( level = "debug" , skip( self , outlives_env) ) ]
127
- pub fn process_registered_region_obligations ( & self , outlives_env : & OutlivesEnvironment < ' tcx > ) {
126
+ #[ instrument( level = "debug" , skip( self , outlives_env, deeply_normalize_ty) ) ]
127
+ pub fn process_registered_region_obligations < E > (
128
+ & self ,
129
+ outlives_env : & OutlivesEnvironment < ' tcx > ,
130
+ mut deeply_normalize_ty : impl FnMut ( Ty < ' tcx > ) -> Result < Ty < ' tcx > , E > ,
131
+ ) -> Result < ( ) , ( E , SubregionOrigin < ' tcx > ) > {
128
132
assert ! ( !self . in_snapshot( ) , "cannot process registered region obligations in a snapshot" ) ;
129
133
130
134
let my_region_obligations = self . take_registered_region_obligations ( ) ;
131
135
132
136
for RegionObligation { sup_type, sub_region, origin } in my_region_obligations {
137
+ let sup_type = deeply_normalize_ty ( sup_type) . map_err ( |e| ( e, origin. clone ( ) ) ) ?;
133
138
debug ! ( ?sup_type, ?sub_region, ?origin) ;
134
- let sup_type = self . resolve_vars_if_possible ( sup_type) ;
135
139
136
140
let outlives = & mut TypeOutlives :: new (
137
141
self ,
@@ -143,6 +147,8 @@ impl<'tcx> InferCtxt<'tcx> {
143
147
let category = origin. to_constraint_category ( ) ;
144
148
outlives. type_must_outlive ( origin, sup_type, sub_region, category) ;
145
149
}
150
+
151
+ Ok ( ( ) )
146
152
}
147
153
}
148
154
0 commit comments