@@ -219,14 +219,14 @@ fn fulfillment_error_for_no_solution<'tcx>(
219
219
}
220
220
ty:: PredicateKind :: Subtype ( pred) => {
221
221
let ( a, b) = infcx. enter_forall_and_leak_universe (
222
- root_obligation . predicate . kind ( ) . rebind ( ( pred. a , pred. b ) ) ,
222
+ obligation . predicate . kind ( ) . rebind ( ( pred. a , pred. b ) ) ,
223
223
) ;
224
224
let expected_found = ExpectedFound :: new ( true , a, b) ;
225
225
FulfillmentErrorCode :: SubtypeError ( expected_found, TypeError :: Sorts ( expected_found) )
226
226
}
227
227
ty:: PredicateKind :: Coerce ( pred) => {
228
228
let ( a, b) = infcx. enter_forall_and_leak_universe (
229
- root_obligation . predicate . kind ( ) . rebind ( ( pred. a , pred. b ) ) ,
229
+ obligation . predicate . kind ( ) . rebind ( ( pred. a , pred. b ) ) ,
230
230
) ;
231
231
let expected_found = ExpectedFound :: new ( false , a, b) ;
232
232
FulfillmentErrorCode :: SubtypeError ( expected_found, TypeError :: Sorts ( expected_found) )
@@ -298,13 +298,8 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
298
298
}
299
299
300
300
fn visit_goal ( & mut self , goal : & super :: inspect:: InspectGoal < ' _ , ' tcx > ) -> Self :: Result {
301
- let candidates = goal. candidates ( ) ;
302
301
// FIXME: Throw out candidates that have no failing WC and >1 failing misc goal.
303
-
304
- // HACK:
305
- if self . obligation . recursion_depth > 3 {
306
- return ControlFlow :: Break ( self . obligation . clone ( ) ) ;
307
- }
302
+ let candidates = goal. candidates ( ) ;
308
303
309
304
let [ candidate] = candidates. as_slice ( ) else {
310
305
return ControlFlow :: Break ( self . obligation . clone ( ) ) ;
@@ -376,7 +371,7 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
376
371
recursion_depth : self_. obligation . recursion_depth + 1 ,
377
372
}
378
373
} ,
379
- |self_| self_ . visit_goal ( & nested_goal ) ,
374
+ |self_| nested_goal . visit_with ( self ) ,
380
375
) ?;
381
376
}
382
377
0 commit comments