Skip to content

Commit 6b27b4f

Browse files
committed
update comment
1 parent 224d3d2 commit 6b27b4f

File tree

1 file changed

+7
-9
lines changed
  • compiler/rustc_type_ir/src/search_graph

1 file changed

+7
-9
lines changed

compiler/rustc_type_ir/src/search_graph/mod.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,18 +381,16 @@ impl PathsToNested {
381381
/// The nested goals of each stack entry and the path from the
382382
/// stack entry to that nested goal.
383383
///
384+
/// They are used when checking whether reevaluating a global cache
385+
/// would encounter a cycle or use a provisional cache entry given the
386+
/// currentl search graph state. We need to disable the global cache
387+
/// in this case as it could otherwise result in behaviorial differences.
388+
/// Cycles can impact behavior. The cycle ABA may have different final
389+
/// results from a the cycle BAB depending on the cycle root.
390+
///
384391
/// We only start tracking nested goals once we've either encountered
385392
/// overflow or a solver cycle. This is a performance optimization to
386393
/// avoid tracking nested goals on the happy path.
387-
///
388-
/// We use nested goals for two reasons:
389-
/// - when rebasing provisional cache entries
390-
/// - when checking whether we have to ignore a global cache entry as reevaluating
391-
/// it would encounter a cycle or use a provisional cache entry.
392-
///
393-
/// We need to disable the global cache if using it would hide a cycle, as
394-
/// cycles can impact behavior. The cycle ABA may have different final
395-
/// results from a the cycle BAB depending on the cycle root.
396394
#[derive_where(Debug, Default, Clone; X: Cx)]
397395
struct NestedGoals<X: Cx> {
398396
nested_goals: HashMap<X::Input, PathsToNested>,

0 commit comments

Comments
 (0)