Skip to content

Commit decd6d3

Browse files
authored
modify comment
modify the comment on `in_cycle` to reflect changes requested by ariel and myself.
1 parent bd005a2 commit decd6d3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/librustc/traits/select.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,15 @@ struct TraitObligationStack<'prev, 'tcx: 'prev> {
173173
/// well as the second instance of `A: AutoTrait`) to supress
174174
/// caching.
175175
///
176-
/// This is a simple, targeted fix. The correct fix requires
176+
/// This is a simple, targeted fix. A more-performant fix requires
177177
/// deeper changes, but would permit more caching: we could
178178
/// basically defer caching until we have fully evaluated the
179-
/// tree, and then cache the entire tree at once.
179+
/// tree, and then cache the entire tree at once. In any case, the
180+
/// performance impact here shouldn't be so horrible: every time
181+
/// this is hit, we do cache at least one trait, so we only
182+
/// evaluate each member of a cycle up to N times, where N is the
183+
/// length of the cycle. This means the performance impact is
184+
/// bounded and we shouldn't have any terrible worst-cases.
180185
in_cycle: Cell<bool>,
181186

182187
previous: TraitObligationStackList<'prev, 'tcx>,

0 commit comments

Comments
 (0)