Skip to content

Commit 4e44d58

Browse files
committed
rename search_graph::Delegate fns
1 parent 4a0c7cc commit 4e44d58

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

compiler/rustc_next_trait_solver/src/solve/search_graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ where
9191
}
9292
}
9393

94-
fn on_stack_overflow(cx: I, input: CanonicalInput<I>) -> QueryResult<I> {
94+
fn stack_overflow_result(cx: I, input: CanonicalInput<I>) -> QueryResult<I> {
9595
response_no_constraints(cx, input, Certainty::overflow(true))
9696
}
9797

98-
fn on_fixpoint_overflow(cx: I, input: CanonicalInput<I>) -> QueryResult<I> {
98+
fn fixpoint_overflow_result(cx: I, input: CanonicalInput<I>) -> QueryResult<I> {
9999
response_no_constraints(cx, input, Certainty::overflow(false))
100100
}
101101

compiler/rustc_type_ir/src/search_graph/mod.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ pub trait Delegate: Sized {
8787
input: <Self::Cx as Cx>::Input,
8888
) -> <Self::Cx as Cx>::Result;
8989
fn is_initial_provisional_result(result: <Self::Cx as Cx>::Result) -> Option<PathKind>;
90-
fn on_stack_overflow(cx: Self::Cx, input: <Self::Cx as Cx>::Input) -> <Self::Cx as Cx>::Result;
91-
fn on_fixpoint_overflow(
90+
fn stack_overflow_result(
91+
cx: Self::Cx,
92+
input: <Self::Cx as Cx>::Input,
93+
) -> <Self::Cx as Cx>::Result;
94+
fn fixpoint_overflow_result(
9295
cx: Self::Cx,
9396
input: <Self::Cx as Cx>::Input,
9497
) -> <Self::Cx as Cx>::Result;
@@ -885,7 +888,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
885888
}
886889

887890
debug!("encountered stack overflow");
888-
D::on_stack_overflow(cx, input)
891+
D::stack_overflow_result(cx, input)
889892
}
890893

891894
/// When reevaluating a goal with a changed provisional result, all provisional cache entry
@@ -1033,7 +1036,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
10331036
RebaseReason::Ambiguity => {
10341037
*result = D::propagate_ambiguity(cx, input, *result);
10351038
}
1036-
RebaseReason::Overflow => *result = D::on_fixpoint_overflow(cx, input),
1039+
RebaseReason::Overflow => *result = D::fixpoint_overflow_result(cx, input),
10371040
RebaseReason::ReachedFixpoint(None) => {}
10381041
RebaseReason::ReachedFixpoint(Some(path_kind)) => {
10391042
if !popped_head.usages.is_single(path_kind) {
@@ -1362,7 +1365,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
13621365
i += 1;
13631366
if i >= D::FIXPOINT_STEP_LIMIT {
13641367
debug!("canonical cycle overflow");
1365-
let result = D::on_fixpoint_overflow(cx, input);
1368+
let result = D::fixpoint_overflow_result(cx, input);
13661369
self.rebase_provisional_cache_entries(cx, &stack_entry, RebaseReason::Overflow);
13671370
return EvaluationResult::finalize(stack_entry, encountered_overflow, result);
13681371
}

0 commit comments

Comments
 (0)