From 4e44d58bbc199ff7c17a98b283621a6df327d60f Mon Sep 17 00:00:00 2001 From: lcnr Date: Fri, 26 Sep 2025 14:51:13 +0200 Subject: [PATCH] rename `search_graph::Delegate` fns --- .../src/solve/search_graph.rs | 4 ++-- compiler/rustc_type_ir/src/search_graph/mod.rs | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs index 4ae2af59a703..109c8476ccb1 100644 --- a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs +++ b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs @@ -91,11 +91,11 @@ where } } - fn on_stack_overflow(cx: I, input: CanonicalInput) -> QueryResult { + fn stack_overflow_result(cx: I, input: CanonicalInput) -> QueryResult { response_no_constraints(cx, input, Certainty::overflow(true)) } - fn on_fixpoint_overflow(cx: I, input: CanonicalInput) -> QueryResult { + fn fixpoint_overflow_result(cx: I, input: CanonicalInput) -> QueryResult { response_no_constraints(cx, input, Certainty::overflow(false)) } diff --git a/compiler/rustc_type_ir/src/search_graph/mod.rs b/compiler/rustc_type_ir/src/search_graph/mod.rs index a7902cd02103..7aa58d096d5c 100644 --- a/compiler/rustc_type_ir/src/search_graph/mod.rs +++ b/compiler/rustc_type_ir/src/search_graph/mod.rs @@ -87,8 +87,11 @@ pub trait Delegate: Sized { input: ::Input, ) -> ::Result; fn is_initial_provisional_result(result: ::Result) -> Option; - fn on_stack_overflow(cx: Self::Cx, input: ::Input) -> ::Result; - fn on_fixpoint_overflow( + fn stack_overflow_result( + cx: Self::Cx, + input: ::Input, + ) -> ::Result; + fn fixpoint_overflow_result( cx: Self::Cx, input: ::Input, ) -> ::Result; @@ -885,7 +888,7 @@ impl, X: Cx> SearchGraph { } debug!("encountered stack overflow"); - D::on_stack_overflow(cx, input) + D::stack_overflow_result(cx, input) } /// When reevaluating a goal with a changed provisional result, all provisional cache entry @@ -1033,7 +1036,7 @@ impl, X: Cx> SearchGraph { RebaseReason::Ambiguity => { *result = D::propagate_ambiguity(cx, input, *result); } - RebaseReason::Overflow => *result = D::on_fixpoint_overflow(cx, input), + RebaseReason::Overflow => *result = D::fixpoint_overflow_result(cx, input), RebaseReason::ReachedFixpoint(None) => {} RebaseReason::ReachedFixpoint(Some(path_kind)) => { if !popped_head.usages.is_single(path_kind) { @@ -1362,7 +1365,7 @@ impl, X: Cx> SearchGraph { i += 1; if i >= D::FIXPOINT_STEP_LIMIT { debug!("canonical cycle overflow"); - let result = D::on_fixpoint_overflow(cx, input); + let result = D::fixpoint_overflow_result(cx, input); self.rebase_provisional_cache_entries(cx, &stack_entry, RebaseReason::Overflow); return EvaluationResult::finalize(stack_entry, encountered_overflow, result); }