@@ -597,7 +597,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
597
597
input : X :: Input ,
598
598
step_kind_from_parent : PathKind ,
599
599
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 ,
601
601
) -> X :: Result {
602
602
let Some ( available_depth) =
603
603
AvailableDepth :: allowed_depth_for_nested :: < D > ( self . root_depth , & self . stack )
@@ -665,9 +665,8 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
665
665
// not tracked by the cache key and from outside of this anon task, it
666
666
// must not be added to the global cache. Notably, this is the case for
667
667
// 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) ) ;
671
670
672
671
// We've finished computing the goal and have popped it from the stack,
673
672
// lazily update its parent goal.
@@ -1065,7 +1064,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
1065
1064
cx : X ,
1066
1065
input : X :: Input ,
1067
1066
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 ,
1069
1068
) -> EvaluationResult < X > {
1070
1069
// We reset `encountered_overflow` each time we rerun this goal
1071
1070
// 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> {
1074
1073
let mut encountered_overflow = false ;
1075
1074
let mut i = 0 ;
1076
1075
loop {
1077
- let result = evaluate_goal ( self , inspect) ;
1076
+ let result = evaluate_goal ( self , cx , input , inspect) ;
1078
1077
let stack_entry = self . stack . pop ( ) ;
1079
1078
encountered_overflow |= stack_entry. encountered_overflow ;
1080
1079
debug_assert_eq ! ( stack_entry. input, input) ;
0 commit comments