@@ -123,15 +123,19 @@ impl<'tcx> InferCtxt<'tcx> {
123123 /// flow of the inferencer. The key point is that it is
124124 /// invoked after all type-inference variables have been bound --
125125 /// 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 > ) > {
128132 assert ! ( !self . in_snapshot( ) , "cannot process registered region obligations in a snapshot" ) ;
129133
130134 let my_region_obligations = self . take_registered_region_obligations ( ) ;
131135
132136 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 ( ) ) ) ?;
133138 debug ! ( ?sup_type, ?sub_region, ?origin) ;
134- let sup_type = self . resolve_vars_if_possible ( sup_type) ;
135139
136140 let outlives = & mut TypeOutlives :: new (
137141 self ,
@@ -143,6 +147,8 @@ impl<'tcx> InferCtxt<'tcx> {
143147 let category = origin. to_constraint_category ( ) ;
144148 outlives. type_must_outlive ( origin, sup_type, sub_region, category) ;
145149 }
150+
151+ Ok ( ( ) )
146152 }
147153}
148154
0 commit comments