Skip to content

Commit

Permalink
Auto merge of rust-lang#101893 - oli-obk:lift_derive, r=lcnr
Browse files Browse the repository at this point in the history
Fix perf regression from TypeVisitor changes

Regression occurred in rust-lang#101858 (comment)

Instead of just reverting, we only fixed part of the regression. The main regression was due to actually correctly visiting a type that contains types and consts and should therefor be visited. This is not actually observable (yet?), but we should still do it correctly instead of risking major bugs in the future.
  • Loading branch information
bors committed Sep 29, 2022
2 parents 65445a5 + f841f1b commit 9f1a21a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/ty/subst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<Ty<'tcx>> {
}

impl<'tcx, T: TypeVisitable<'tcx>> TypeVisitable<'tcx> for &'tcx ty::List<T> {
#[inline]
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
self.iter().try_for_each(|t| t.visit_with(visitor))
}
Expand Down

0 comments on commit 9f1a21a

Please sign in to comment.