Skip to content

Commit 7c20f9c

Browse files
committed
fix comments about trait solver cycle heads
1 parent bea625f commit 7c20f9c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_type_ir/src/search_graph/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
12621262
encountered_overflow |= stack_entry.encountered_overflow;
12631263
debug_assert_eq!(stack_entry.input, input);
12641264

1265-
// If the current goal is not the root of a cycle, we are done.
1265+
// If the current goal is not a cycle head, we are done.
12661266
//
12671267
// There are no provisional cache entries which depend on this goal.
12681268
let Some(usages) = stack_entry.usages else {
@@ -1278,7 +1278,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
12781278
//
12791279
// Check whether we reached a fixpoint, either because the final result
12801280
// is equal to the provisional result of the previous iteration, or because
1281-
// this was only the root of either coinductive or inductive cycles, and the
1281+
// this was only the head of either coinductive or inductive cycles, and the
12821282
// final result is equal to the initial response for that case.
12831283
if self.reached_fixpoint(cx, &stack_entry, usages, result) {
12841284
self.rebase_provisional_cache_entries(&stack_entry, |_, result| result);

compiler/rustc_type_ir/src/search_graph/stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rustc_index::newtype_index! {
1313
pub(super) struct StackDepth {}
1414
}
1515

16-
/// Stack entries of the evaluation stack. Its fields tend to be lazily
16+
/// Stack entries of the evaluation stack. Its fields tend to be lazily updated
1717
/// when popping a child goal or completely immutable.
1818
#[derive_where(Debug; X: Cx)]
1919
pub(super) struct StackEntry<X: Cx> {
@@ -42,7 +42,7 @@ pub(super) struct StackEntry<X: Cx> {
4242
/// Whether evaluating this goal encountered overflow. Lazily updated.
4343
pub encountered_overflow: bool,
4444

45-
/// Whether and how this goal has been used as the root of a cycle. Lazily updated.
45+
/// Whether and how this goal has been used as a cycle head. Lazily updated.
4646
pub usages: Option<HeadUsages>,
4747

4848
/// We want to be able to ignore head usages if they happen inside of candidates

0 commit comments

Comments
 (0)