@@ -207,7 +207,7 @@ fn project_and_unify_type<'cx, 'gcx, 'tcx>(
207
207
debug ! ( "project_and_unify_type(obligation={:?})" ,
208
208
obligation) ;
209
209
210
- let Normalized { value : normalized_ty, obligations } =
210
+ let Normalized { value : normalized_ty, mut obligations } =
211
211
match opt_normalize_projection_type ( selcx,
212
212
obligation. predicate . projection_ty . clone ( ) ,
213
213
obligation. cause . clone ( ) ,
@@ -224,8 +224,9 @@ fn project_and_unify_type<'cx, 'gcx, 'tcx>(
224
224
let origin = TypeOrigin :: RelateOutputImplTypes ( obligation. cause . span ) ;
225
225
match infcx. eq_types ( true , origin, normalized_ty, obligation. predicate . ty ) {
226
226
Ok ( InferOk { obligations : inferred_obligations, .. } ) => {
227
- // FIXME(#32730) propagate obligations
227
+ // FIXME(#32730) once obligations are generated in inference, drop this assertion
228
228
assert ! ( inferred_obligations. is_empty( ) ) ;
229
+ obligations. extend ( inferred_obligations) ;
229
230
Ok ( Some ( obligations) )
230
231
} ,
231
232
Err ( err) => Err ( MismatchedProjectionTypes { err : err } ) ,
@@ -710,7 +711,8 @@ fn assemble_candidates_from_predicates<'cx, 'gcx, 'tcx, I>(
710
711
origin,
711
712
data_poly_trait_ref,
712
713
obligation_poly_trait_ref)
713
- // FIXME(#32730) propagate obligations
714
+ // FIXME(#32730) once obligations are propagated from unification in
715
+ // inference, drop this assertion
714
716
. map ( |InferOk { obligations, .. } | assert ! ( obligations. is_empty( ) ) )
715
717
. is_ok ( )
716
718
} ) ;
@@ -1047,8 +1049,8 @@ fn confirm_fn_pointer_candidate<'cx, 'gcx, 'tcx>(
1047
1049
fn_pointer_vtable : VtableFnPointerData < ' tcx , PredicateObligation < ' tcx > > )
1048
1050
-> ( Ty < ' tcx > , Vec < PredicateObligation < ' tcx > > )
1049
1051
{
1050
- // FIXME(#32730) propagate obligations (fn pointer vtable nested obligations ONLY come from
1051
- // unification in inference)
1052
+ // FIXME(#32730) drop this assertion once obligations are propagated from inference (fn pointer
1053
+ // vtable nested obligations ONLY come from unification in inference)
1052
1054
assert ! ( fn_pointer_vtable. nested. is_empty( ) ) ;
1053
1055
let fn_type = selcx. infcx ( ) . shallow_resolve ( fn_pointer_vtable. fn_ty ) ;
1054
1056
let sig = fn_type. fn_sig ( ) ;
@@ -1130,13 +1132,14 @@ fn confirm_param_env_candidate<'cx, 'gcx, 'tcx>(
1130
1132
obligation. predicate. item_name) ;
1131
1133
1132
1134
let origin = TypeOrigin :: RelateOutputImplTypes ( obligation. cause . span ) ;
1133
- match infcx. eq_trait_refs ( false ,
1134
- origin,
1135
- obligation. predicate . trait_ref . clone ( ) ,
1136
- projection. projection_ty . trait_ref . clone ( ) ) {
1135
+ let obligations = match infcx. eq_trait_refs ( false ,
1136
+ origin,
1137
+ obligation. predicate . trait_ref . clone ( ) ,
1138
+ projection. projection_ty . trait_ref . clone ( ) ) {
1137
1139
Ok ( InferOk { obligations, .. } ) => {
1138
- // FIXME(#32730) propagate obligations
1140
+ // FIXME(#32730) once obligations are generated in inference, remove this assertion
1139
1141
assert ! ( obligations. is_empty( ) ) ;
1142
+ obligations
1140
1143
}
1141
1144
Err ( e) => {
1142
1145
span_bug ! (
@@ -1146,9 +1149,9 @@ fn confirm_param_env_candidate<'cx, 'gcx, 'tcx>(
1146
1149
projection,
1147
1150
e) ;
1148
1151
}
1149
- }
1152
+ } ;
1150
1153
1151
- ( projection. ty , vec ! ( ) )
1154
+ ( projection. ty , obligations )
1152
1155
}
1153
1156
1154
1157
fn confirm_impl_candidate < ' cx , ' gcx , ' tcx > (
0 commit comments