Skip to content

Commit f841f1b

Browse files
committed
Retry with inlining attributes
1 parent 18ab705 commit f841f1b

File tree

4 files changed

+3
-40
lines changed

4 files changed

+3
-40
lines changed

compiler/rustc_middle/src/infer/canonical.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use rustc_index::vec::IndexVec;
2929
use rustc_macros::HashStable;
3030
use smallvec::SmallVec;
3131
use std::iter;
32-
use std::ops::{ControlFlow, Index};
32+
use std::ops::Index;
3333

3434
/// A "canonicalized" type `V` is one where all free inference
3535
/// variables have been rewritten to "canonical vars". These are
@@ -53,12 +53,6 @@ impl<'tcx> ty::TypeFoldable<'tcx> for CanonicalVarInfos<'tcx> {
5353
}
5454
}
5555

56-
impl<'tcx> ty::TypeVisitable<'tcx> for CanonicalVarInfos<'tcx> {
57-
fn visit_with<V: ty::TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
58-
self.iter().try_for_each(|t| t.visit_with(visitor))
59-
}
60-
}
61-
6256
/// A set of values corresponding to the canonical variables from some
6357
/// `Canonical`. You can give these values to
6458
/// `canonical_value.substitute` to substitute them into the canonical

compiler/rustc_middle/src/mir/type_visitable.rs

-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ impl<'tcx, R: Idx, C: Idx> TypeVisitable<'tcx> for BitMatrix<R, C> {
88
}
99
}
1010

11-
impl<'tcx> TypeVisitable<'tcx> for &'tcx ty::List<PlaceElem<'tcx>> {
12-
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
13-
self.iter().try_for_each(|t| t.visit_with(visitor))
14-
}
15-
}
16-
1711
impl<'tcx> TypeVisitable<'tcx> for ConstantKind<'tcx> {
1812
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
1913
visitor.visit_mir_const(*self)

compiler/rustc_middle/src/ty/structural_impls.rs

-20
Original file line numberDiff line numberDiff line change
@@ -602,26 +602,12 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<ty::Binder<'tcx, ty::Existentia
602602
}
603603
}
604604

605-
impl<'tcx> TypeVisitable<'tcx>
606-
for &'tcx ty::List<ty::Binder<'tcx, ty::ExistentialPredicate<'tcx>>>
607-
{
608-
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
609-
self.iter().try_for_each(|p| p.visit_with(visitor))
610-
}
611-
}
612-
613605
impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<ProjectionKind> {
614606
fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
615607
ty::util::fold_list(self, folder, |tcx, v| tcx.intern_projs(v))
616608
}
617609
}
618610

619-
impl<'tcx> TypeVisitable<'tcx> for &'tcx ty::List<ProjectionKind> {
620-
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
621-
self.iter().try_for_each(|t| t.visit_with(visitor))
622-
}
623-
}
624-
625611
impl<'tcx> TypeFoldable<'tcx> for Ty<'tcx> {
626612
fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
627613
folder.try_fold_ty(self)
@@ -797,12 +783,6 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<ty::Predicate<'tcx>> {
797783
}
798784
}
799785

800-
impl<'tcx> TypeVisitable<'tcx> for &'tcx ty::List<ty::Predicate<'tcx>> {
801-
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
802-
self.iter().try_for_each(|p| p.visit_with(visitor))
803-
}
804-
}
805-
806786
impl<'tcx, T: TypeFoldable<'tcx>, I: Idx> TypeFoldable<'tcx> for IndexVec<I, T> {
807787
fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
808788
self.try_map_id(|x| x.try_fold_with(folder))

compiler/rustc_middle/src/ty/subst.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,6 @@ impl<'tcx> TypeFoldable<'tcx> for SubstsRef<'tcx> {
459459
}
460460
}
461461

462-
impl<'tcx> TypeVisitable<'tcx> for SubstsRef<'tcx> {
463-
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
464-
self.iter().try_for_each(|t| t.visit_with(visitor))
465-
}
466-
}
467-
468462
impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<Ty<'tcx>> {
469463
fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
470464
// This code is fairly hot, though not as hot as `SubstsRef`.
@@ -497,7 +491,8 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<Ty<'tcx>> {
497491
}
498492
}
499493

500-
impl<'tcx> TypeVisitable<'tcx> for &'tcx ty::List<Ty<'tcx>> {
494+
impl<'tcx, T: TypeVisitable<'tcx>> TypeVisitable<'tcx> for &'tcx ty::List<T> {
495+
#[inline]
501496
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
502497
self.iter().try_for_each(|t| t.visit_with(visitor))
503498
}

0 commit comments

Comments
 (0)