@@ -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 ( ) ,
@@ -1127,7 +1136,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1127
1136
self . borrowck_context . universal_regions ,
1128
1137
self . region_bound_pairs ,
1129
1138
self . implicit_region_bound ,
1130
- self . param_env ,
1139
+ self . known_type_outlives_obligations ,
1131
1140
locations,
1132
1141
locations. span ( self . body ) ,
1133
1142
category,
@@ -2731,7 +2740,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2731
2740
self . borrowck_context . universal_regions ,
2732
2741
self . region_bound_pairs ,
2733
2742
self . implicit_region_bound ,
2734
- self . param_env ,
2743
+ self . known_type_outlives_obligations ,
2735
2744
locations,
2736
2745
DUMMY_SP , // irrelevant; will be overridden.
2737
2746
ConstraintCategory :: Boring , // same as above.
0 commit comments