@@ -597,7 +597,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
597597 input : X :: Input ,
598598 step_kind_from_parent : PathKind ,
599599 inspect : & mut D :: ProofTreeBuilder ,
600- mut evaluate_goal : impl FnMut ( & mut Self , & mut D :: ProofTreeBuilder ) -> X :: Result ,
600+ evaluate_goal : impl Fn ( & mut Self , X , X :: Input , & mut D :: ProofTreeBuilder ) -> X :: Result + Copy ,
601601 ) -> X :: Result {
602602 let Some ( available_depth) =
603603 AvailableDepth :: allowed_depth_for_nested :: < D > ( self . root_depth , & self . stack )
@@ -665,9 +665,8 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
665665 // not tracked by the cache key and from outside of this anon task, it
666666 // must not be added to the global cache. Notably, this is the case for
667667 // trait solver cycles participants.
668- let ( evaluation_result, dep_node) = cx. with_cached_task ( || {
669- self . evaluate_goal_in_task ( cx, input, inspect, & mut evaluate_goal)
670- } ) ;
668+ let ( evaluation_result, dep_node) =
669+ cx. with_cached_task ( || self . evaluate_goal_in_task ( cx, input, inspect, evaluate_goal) ) ;
671670
672671 // We've finished computing the goal and have popped it from the stack,
673672 // lazily update its parent goal.
@@ -1065,7 +1064,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
10651064 cx : X ,
10661065 input : X :: Input ,
10671066 inspect : & mut D :: ProofTreeBuilder ,
1068- mut evaluate_goal : impl FnMut ( & mut Self , & mut D :: ProofTreeBuilder ) -> X :: Result ,
1067+ evaluate_goal : impl Fn ( & mut Self , X , X :: Input , & mut D :: ProofTreeBuilder ) -> X :: Result + Copy ,
10691068 ) -> EvaluationResult < X > {
10701069 // We reset `encountered_overflow` each time we rerun this goal
10711070 // but need to make sure we currently propagate it to the global
@@ -1074,7 +1073,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
10741073 let mut encountered_overflow = false ;
10751074 let mut i = 0 ;
10761075 loop {
1077- let result = evaluate_goal ( self , inspect) ;
1076+ let result = evaluate_goal ( self , cx , input , inspect) ;
10781077 let stack_entry = self . stack . pop ( ) ;
10791078 encountered_overflow |= stack_entry. encountered_overflow ;
10801079 debug_assert_eq ! ( stack_entry. input, input) ;
0 commit comments