| ... | ... | @@ -842,9 +842,8 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> { |
| 842 | 842 | /// evaluating this entry would not have ended up depending on either a goal |
| 843 | 843 | /// already on the stack or a provisional cache entry. |
| 844 | 844 | fn candidate_is_applicable( |
| 845 | | stack: &Stack<X>, |
| 845 | &self, |
| 846 | 846 | step_kind_from_parent: PathKind, |
| 847 | | provisional_cache: &HashMap<X::Input, Vec<ProvisionalCacheEntry<X>>>, |
| 848 | 847 | nested_goals: &NestedGoals<X>, |
| 849 | 848 | ) -> bool { |
| 850 | 849 | // If the global cache entry didn't depend on any nested goals, it always |
| ... | ... | @@ -855,7 +854,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> { |
| 855 | 854 | |
| 856 | 855 | // If a nested goal of the global cache entry is on the stack, we would |
| 857 | 856 | // definitely encounter a cycle. |
| 858 | | if stack.iter().any(|e| nested_goals.contains(e.input)) { |
| 857 | if self.stack.iter().any(|e| nested_goals.contains(e.input)) { |
| 859 | 858 | debug!("cache entry not applicable due to stack"); |
| 860 | 859 | return false; |
| 861 | 860 | } |
| ... | ... | @@ -864,7 +863,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> { |
| 864 | 863 | // would apply for any of its nested goals. |
| 865 | 864 | #[allow(rustc::potential_query_instability)] |
| 866 | 865 | for (input, path_from_global_entry) in nested_goals.iter() { |
| 867 | | let Some(entries) = provisional_cache.get(&input) else { |
| 866 | let Some(entries) = self.provisional_cache.get(&input) else { |
| 868 | 867 | continue; |
| 869 | 868 | }; |
| 870 | 869 | |
| ... | ... | @@ -890,7 +889,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> { |
| 890 | 889 | // We check if any of the paths taken while computing the global goal |
| 891 | 890 | // would end up with an applicable provisional cache entry. |
| 892 | 891 | let head = heads.highest_cycle_head(); |
| 893 | | let head_to_curr = Self::cycle_path_kind(stack, step_kind_from_parent, head); |
| 892 | let head_to_curr = Self::cycle_path_kind(&self.stack, step_kind_from_parent, head); |
| 894 | 893 | let full_paths = path_from_global_entry.extend_with(head_to_curr); |
| 895 | 894 | if full_paths.contains(head_to_provisional.into()) { |
| 896 | 895 | debug!( |
| ... | ... | @@ -918,12 +917,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> { |
| 918 | 917 | cx.with_global_cache(|cache| { |
| 919 | 918 | cache |
| 920 | 919 | .get(cx, input, available_depth, |nested_goals| { |
| 921 | | Self::candidate_is_applicable( |
| 922 | | &self.stack, |
| 923 | | step_kind_from_parent, |
| 924 | | &self.provisional_cache, |
| 925 | | nested_goals, |
| 926 | | ) |
| 920 | self.candidate_is_applicable(step_kind_from_parent, nested_goals) |
| 927 | 921 | }) |
| 928 | 922 | .map(|c| c.result) |
| 929 | 923 | }) |
| ... | ... | @@ -942,12 +936,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> { |
| 942 | 936 | cx.with_global_cache(|cache| { |
| 943 | 937 | let CacheData { result, required_depth, encountered_overflow, nested_goals } = cache |
| 944 | 938 | .get(cx, input, available_depth, |nested_goals| { |
| 945 | | Self::candidate_is_applicable( |
| 946 | | &self.stack, |
| 947 | | step_kind_from_parent, |
| 948 | | &self.provisional_cache, |
| 949 | | nested_goals, |
| 950 | | ) |
| 939 | self.candidate_is_applicable(step_kind_from_parent, nested_goals) |
| 951 | 940 | })?; |
| 952 | 941 | |
| 953 | 942 | // We don't move cycle participants to the global cache, so the |