@@ -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 ( ) ,
@@ -1120,7 +1129,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
11201129 self . borrowck_context . universal_regions ,
11211130 self . region_bound_pairs ,
11221131 self . implicit_region_bound ,
1123- self . param_env ,
1132+ self . known_type_outlives_obligations ,
11241133 locations,
11251134 locations. span ( self . body ) ,
11261135 category,
@@ -2683,7 +2692,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
26832692 self . borrowck_context . universal_regions ,
26842693 self . region_bound_pairs ,
26852694 self . implicit_region_bound ,
2686- self . param_env ,
2695+ self . known_type_outlives_obligations ,
26872696 location. to_locations ( ) ,
26882697 DUMMY_SP , // irrelevant; will be overridden.
26892698 ConstraintCategory :: Boring , // same as above.
0 commit comments