about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2023-01-17 16:00:00 +0100
committerlcnr <rust@lcnr.de>2023-01-18 08:11:15 +0100
commit415aa663a2cafd07d934dd683db6ab88e65f6c30 (patch)
treee20cbf5f5ad5ca7a87af1a10ce5734fba92489da /compiler/rustc_trait_selection/src
parent31ac29d9899c063fdee7a78988990f2b037bef7b (diff)
downloadrust-415aa663a2cafd07d934dd683db6ab88e65f6c30.tar.gz
rust-415aa663a2cafd07d934dd683db6ab88e65f6c30.zip
add note about indirect cycles
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/solve/search_graph/cache.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/search_graph/cache.rs b/compiler/rustc_trait_selection/src/solve/search_graph/cache.rs
index cb00fe6bf14..730a8e61258 100644
--- a/compiler/rustc_trait_selection/src/solve/search_graph/cache.rs
+++ b/compiler/rustc_trait_selection/src/solve/search_graph/cache.rs
@@ -59,6 +59,10 @@ impl<'tcx> ProvisionalCache<'tcx> {
     /// Adds a dependency from the current leaf to `target` in the cache
     /// to prevent us from moving any goals which depend on the current leaf
     /// to the global cache while we're still computing `target`.
+    ///
+    /// Its important to note that `target` may already be part of a different cycle.
+    /// In this case we have to ensure that we also depend on all other goals
+    /// in the existing cycle in addition to the potentially direct cycle with `target`.
     pub(super) fn add_dependency_of_leaf_on(&mut self, target: EntryIndex) {
         let depth = self.entries[target].depth;
         for provisional_entry in &mut self.entries.raw[target.index()..] {