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