about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S Klock II <pnkfelix@pnkfx.org>2019-05-13 13:29:49 +0200
committerGitHub <noreply@github.com>2019-05-13 13:29:49 +0200
commitdecd6d366018823a8b1116b346bc778eb010accd (patch)
tree1649e976af6d8742ecbe3327776f6eaea989f1be
parentbd005a242a3125c432a76f982dab5a8d59e970f2 (diff)
downloadrust-decd6d366018823a8b1116b346bc778eb010accd.tar.gz
rust-decd6d366018823a8b1116b346bc778eb010accd.zip
modify comment
modify the comment on `in_cycle` to reflect changes requested by ariel and myself.
-rw-r--r--src/librustc/traits/select.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs
index 3c4d48b17b9..b333f4b9651 100644
--- a/src/librustc/traits/select.rs
+++ b/src/librustc/traits/select.rs
@@ -173,10 +173,15 @@ struct TraitObligationStack<'prev, 'tcx: 'prev> {
     /// well as the second instance of `A: AutoTrait`) to supress
     /// caching.
     ///
-    /// This is a simple, targeted fix. The correct fix requires
+    /// This is a simple, targeted fix. A more-performant fix requires
     /// deeper changes, but would permit more caching: we could
     /// basically defer caching until we have fully evaluated the
-    /// tree, and then cache the entire tree at once.
+    /// tree, and then cache the entire tree at once. In any case, the
+    /// performance impact here shouldn't be so horrible: every time
+    /// this is hit, we do cache at least one trait, so we only
+    /// evaluate each member of a cycle up to N times, where N is the
+    /// length of the cycle. This means the performance impact is
+    /// bounded and we shouldn't have any terrible worst-cases.
     in_cycle: Cell<bool>,
 
     previous: TraitObligationStackList<'prev, 'tcx>,