@@ -219,14 +219,14 @@ fn fulfillment_error_for_no_solution<'tcx>(
219219 }
220220 ty:: PredicateKind :: Subtype ( pred) => {
221221 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 ) ) ,
223223 ) ;
224224 let expected_found = ExpectedFound :: new ( true , a, b) ;
225225 FulfillmentErrorCode :: SubtypeError ( expected_found, TypeError :: Sorts ( expected_found) )
226226 }
227227 ty:: PredicateKind :: Coerce ( pred) => {
228228 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 ) ) ,
230230 ) ;
231231 let expected_found = ExpectedFound :: new ( false , a, b) ;
232232 FulfillmentErrorCode :: SubtypeError ( expected_found, TypeError :: Sorts ( expected_found) )
@@ -298,13 +298,8 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
298298 }
299299
300300 fn visit_goal ( & mut self , goal : & super :: inspect:: InspectGoal < ' _ , ' tcx > ) -> Self :: Result {
301- let candidates = goal. candidates ( ) ;
302301 // 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 ( ) ;
308303
309304 let [ candidate] = candidates. as_slice ( ) else {
310305 return ControlFlow :: Break ( self . obligation . clone ( ) ) ;
@@ -376,7 +371,7 @@ impl<'tcx> ProofTreeVisitor<'tcx> for BestObligation<'tcx> {
376371 recursion_depth : self_. obligation . recursion_depth + 1 ,
377372 }
378373 } ,
379- |self_| self_ . visit_goal ( & nested_goal ) ,
374+ |self_| nested_goal . visit_with ( self ) ,
380375 ) ?;
381376 }
382377
0 commit comments