@@ -170,44 +170,12 @@ where
170
170
// collecting region constraints via `region_constraints`.
171
171
let ( mut output, _) = scrape_region_constraints (
172
172
infcx,
173
- |_ocx | {
174
- let ( output, ei, mut obligations, _) =
173
+ |ocx | {
174
+ let ( output, ei, obligations, _) =
175
175
Q :: fully_perform_into ( self , infcx, & mut region_constraints, span) ?;
176
176
error_info = ei;
177
177
178
- // Typically, instantiating NLL query results does not
179
- // create obligations. However, in some cases there
180
- // are unresolved type variables, and unify them *can*
181
- // create obligations. In that case, we have to go
182
- // fulfill them. We do this via a (recursive) query.
183
- while !obligations. is_empty ( ) {
184
- trace ! ( "{:#?}" , obligations) ;
185
- let mut progress = false ;
186
- for obligation in std:: mem:: take ( & mut obligations) {
187
- let obligation = infcx. resolve_vars_if_possible ( obligation) ;
188
- match ProvePredicate :: fully_perform_into (
189
- obligation. param_env . and ( ProvePredicate :: new ( obligation. predicate ) ) ,
190
- infcx,
191
- & mut region_constraints,
192
- span,
193
- ) {
194
- Ok ( ( ( ) , _, new, certainty) ) => {
195
- obligations. extend ( new) ;
196
- progress = true ;
197
- if let Certainty :: Ambiguous = certainty {
198
- obligations. push ( obligation) ;
199
- }
200
- }
201
- Err ( _) => obligations. push ( obligation) ,
202
- }
203
- }
204
- if !progress {
205
- infcx. dcx ( ) . span_bug (
206
- span,
207
- format ! ( "ambiguity processing {obligations:?} from {self:?}" ) ,
208
- ) ;
209
- }
210
- }
178
+ ocx. register_obligations ( obligations) ;
211
179
Ok ( output)
212
180
} ,
213
181
"fully_perform" ,
0 commit comments