@@ -152,9 +152,14 @@ pub(crate) fn type_check<'mir, 'tcx>(
152152 universal_region_relations,
153153 region_bound_pairs,
154154 normalized_inputs_and_output,
155+ known_type_outlives_obligations,
155156 } = free_region_relations:: create (
156157 infcx,
157158 param_env,
159+ // FIXME(-Znext-solver): These are unnormalized. Normalize them.
160+ infcx. tcx . arena . alloc_from_iter (
161+ param_env. caller_bounds ( ) . iter ( ) . filter_map ( |clause| clause. as_type_outlives_clause ( ) ) ,
162+ ) ,
158163 implicit_region_bound,
159164 universal_regions,
160165 & mut constraints,
@@ -176,6 +181,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
176181 body,
177182 param_env,
178183 & region_bound_pairs,
184+ known_type_outlives_obligations,
179185 implicit_region_bound,
180186 & mut borrowck_context,
181187 ) ;
@@ -850,6 +856,7 @@ struct TypeChecker<'a, 'tcx> {
850856 /// all of the promoted items.
851857 user_type_annotations : & ' a CanonicalUserTypeAnnotations < ' tcx > ,
852858 region_bound_pairs : & ' a RegionBoundPairs < ' tcx > ,
859+ known_type_outlives_obligations : & ' tcx [ ty:: PolyTypeOutlivesPredicate < ' tcx > ] ,
853860 implicit_region_bound : ty:: Region < ' tcx > ,
854861 reported_errors : FxIndexSet < ( Ty < ' tcx > , Span ) > ,
855862 borrowck_context : & ' a mut BorrowCheckContext < ' a , ' tcx > ,
@@ -1000,6 +1007,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
10001007 body : & ' a Body < ' tcx > ,
10011008 param_env : ty:: ParamEnv < ' tcx > ,
10021009 region_bound_pairs : & ' a RegionBoundPairs < ' tcx > ,
1010+ known_type_outlives_obligations : & ' tcx [ ty:: PolyTypeOutlivesPredicate < ' tcx > ] ,
10031011 implicit_region_bound : ty:: Region < ' tcx > ,
10041012 borrowck_context : & ' a mut BorrowCheckContext < ' a , ' tcx > ,
10051013 ) -> Self {
@@ -1010,6 +1018,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
10101018 user_type_annotations : & body. user_type_annotations ,
10111019 param_env,
10121020 region_bound_pairs,
1021+ known_type_outlives_obligations,
10131022 implicit_region_bound,
10141023 borrowck_context,
10151024 reported_errors : Default :: default ( ) ,
@@ -1127,7 +1136,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
11271136 self . borrowck_context . universal_regions ,
11281137 self . region_bound_pairs ,
11291138 self . implicit_region_bound ,
1130- self . param_env ,
1139+ self . known_type_outlives_obligations ,
11311140 locations,
11321141 locations. span ( self . body ) ,
11331142 category,
@@ -2731,7 +2740,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
27312740 self . borrowck_context . universal_regions ,
27322741 self . region_bound_pairs ,
27332742 self . implicit_region_bound ,
2734- self . param_env ,
2743+ self . known_type_outlives_obligations ,
27352744 locations,
27362745 DUMMY_SP , // irrelevant; will be overridden.
27372746 ConstraintCategory :: Boring , // same as above.
0 commit comments