Skip to content

Commit

Permalink
modify comment
Browse files Browse the repository at this point in the history
modify the comment on `in_cycle` to reflect changes requested by ariel and myself.
  • Loading branch information
pnkfelix committed May 13, 2019
1 parent bd005a2 commit decd6d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librustc/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down

0 comments on commit decd6d3

Please sign in to comment.