File tree 1 file changed +7
-2
lines changed
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> {
173
173
/// well as the second instance of `A: AutoTrait`) to supress
174
174
/// caching.
175
175
///
176
- /// This is a simple, targeted fix. The correct fix requires
176
+ /// This is a simple, targeted fix. A more-performant fix requires
177
177
/// deeper changes, but would permit more caching: we could
178
178
/// 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.
180
185
in_cycle : Cell < bool > ,
181
186
182
187
previous : TraitObligationStackList < ' prev , ' tcx > ,
You can’t perform that action at this time.
0 commit comments