@@ -152,9 +152,14 @@ pub(crate) fn type_check<'mir, 'tcx>(
152
152
universal_region_relations,
153
153
region_bound_pairs,
154
154
normalized_inputs_and_output,
155
+ known_type_outlives_obligations,
155
156
} = free_region_relations:: create (
156
157
infcx,
157
158
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
+ ) ,
158
163
implicit_region_bound,
159
164
universal_regions,
160
165
& mut constraints,
@@ -176,6 +181,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
176
181
body,
177
182
param_env,
178
183
& region_bound_pairs,
184
+ known_type_outlives_obligations,
179
185
implicit_region_bound,
180
186
& mut borrowck_context,
181
187
) ;
@@ -850,6 +856,7 @@ struct TypeChecker<'a, 'tcx> {
850
856
/// all of the promoted items.
851
857
user_type_annotations : & ' a CanonicalUserTypeAnnotations < ' tcx > ,
852
858
region_bound_pairs : & ' a RegionBoundPairs < ' tcx > ,
859
+ known_type_outlives_obligations : & ' tcx [ ty:: PolyTypeOutlivesPredicate < ' tcx > ] ,
853
860
implicit_region_bound : ty:: Region < ' tcx > ,
854
861
reported_errors : FxIndexSet < ( Ty < ' tcx > , Span ) > ,
855
862
borrowck_context : & ' a mut BorrowCheckContext < ' a , ' tcx > ,
@@ -1000,6 +1007,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1000
1007
body : & ' a Body < ' tcx > ,
1001
1008
param_env : ty:: ParamEnv < ' tcx > ,
1002
1009
region_bound_pairs : & ' a RegionBoundPairs < ' tcx > ,
1010
+ known_type_outlives_obligations : & ' tcx [ ty:: PolyTypeOutlivesPredicate < ' tcx > ] ,
1003
1011
implicit_region_bound : ty:: Region < ' tcx > ,
1004
1012
borrowck_context : & ' a mut BorrowCheckContext < ' a , ' tcx > ,
1005
1013
) -> Self {
@@ -1010,6 +1018,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1010
1018
user_type_annotations : & body. user_type_annotations ,
1011
1019
param_env,
1012
1020
region_bound_pairs,
1021
+ known_type_outlives_obligations,
1013
1022
implicit_region_bound,
1014
1023
borrowck_context,
1015
1024
reported_errors : Default :: default ( ) ,
@@ -1120,7 +1129,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1120
1129
self . borrowck_context . universal_regions ,
1121
1130
self . region_bound_pairs ,
1122
1131
self . implicit_region_bound ,
1123
- self . param_env ,
1132
+ self . known_type_outlives_obligations ,
1124
1133
locations,
1125
1134
locations. span ( self . body ) ,
1126
1135
category,
@@ -2683,7 +2692,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2683
2692
self . borrowck_context . universal_regions ,
2684
2693
self . region_bound_pairs ,
2685
2694
self . implicit_region_bound ,
2686
- self . param_env ,
2695
+ self . known_type_outlives_obligations ,
2687
2696
location. to_locations ( ) ,
2688
2697
DUMMY_SP , // irrelevant; will be overridden.
2689
2698
ConstraintCategory :: Boring , // same as above.
0 commit comments