Skip to content

Commit 415aa66

Browse files
committed
add note about indirect cycles
1 parent 31ac29d commit 415aa66

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_trait_selection/src/solve/search_graph

1 file changed

+4
-0
lines changed

compiler/rustc_trait_selection/src/solve/search_graph/cache.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ impl<'tcx> ProvisionalCache<'tcx> {
5959
/// Adds a dependency from the current leaf to `target` in the cache
6060
/// to prevent us from moving any goals which depend on the current leaf
6161
/// to the global cache while we're still computing `target`.
62+
///
63+
/// Its important to note that `target` may already be part of a different cycle.
64+
/// In this case we have to ensure that we also depend on all other goals
65+
/// in the existing cycle in addition to the potentially direct cycle with `target`.
6266
pub(super) fn add_dependency_of_leaf_on(&mut self, target: EntryIndex) {
6367
let depth = self.entries[target].depth;
6468
for provisional_entry in &mut self.entries.raw[target.index()..] {

0 commit comments

Comments
 (0)