File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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 > ,
You can’t perform that action at this time.
0 commit comments