Skip to content

Commit c0e8fff

Browse files
committed
rustc: remove unused TypeFolder methods.
1 parent 552ab37 commit c0e8fff

File tree

3 files changed

+0
-47
lines changed

3 files changed

+0
-47
lines changed

src/librustc/ty/fold.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
//! These methods return true to indicate that the visitor has found what it is looking for
4040
//! and does not need to visit anything else.
4141
42-
use ty::subst::Substs;
43-
use ty::adjustment;
4442
use ty::{self, Binder, Ty, TyCtxt, TypeFlags};
4543

4644
use std::fmt;
@@ -138,34 +136,9 @@ pub trait TypeFolder<'gcx: 'tcx, 'tcx> : Sized {
138136
t.super_fold_with(self)
139137
}
140138

141-
fn fold_mt(&mut self, t: &ty::TypeAndMut<'tcx>) -> ty::TypeAndMut<'tcx> {
142-
t.super_fold_with(self)
143-
}
144-
145-
fn fold_impl_header(&mut self, imp: &ty::ImplHeader<'tcx>) -> ty::ImplHeader<'tcx> {
146-
imp.super_fold_with(self)
147-
}
148-
149-
fn fold_substs(&mut self,
150-
substs: &'tcx Substs<'tcx>)
151-
-> &'tcx Substs<'tcx> {
152-
substs.super_fold_with(self)
153-
}
154-
155-
fn fold_fn_sig(&mut self,
156-
sig: &ty::FnSig<'tcx>)
157-
-> ty::FnSig<'tcx> {
158-
sig.super_fold_with(self)
159-
}
160-
161139
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
162140
r.super_fold_with(self)
163141
}
164-
165-
fn fold_autoref(&mut self, ar: &adjustment::AutoBorrow<'tcx>)
166-
-> adjustment::AutoBorrow<'tcx> {
167-
ar.super_fold_with(self)
168-
}
169142
}
170143

171144
pub trait TypeVisitor<'tcx> : Sized {

src/librustc/ty/structural_impls.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::TypeAndMut<'tcx> {
532532
ty::TypeAndMut { ty: self.ty.fold_with(folder), mutbl: self.mutbl }
533533
}
534534

535-
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
536-
folder.fold_mt(self)
537-
}
538-
539535
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
540536
self.ty.visit_with(visitor)
541537
}
@@ -552,10 +548,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::FnSig<'tcx> {
552548
}
553549
}
554550

555-
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
556-
folder.fold_fn_sig(self)
557-
}
558-
559551
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
560552
self.inputs().iter().any(|i| i.visit_with(visitor)) ||
561553
self.output().visit_with(visitor)
@@ -602,10 +594,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::ImplHeader<'tcx> {
602594
}
603595
}
604596

605-
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
606-
folder.fold_impl_header(self)
607-
}
608-
609597
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
610598
self.self_ty.visit_with(visitor) ||
611599
self.trait_ref.map(|r| r.visit_with(visitor)).unwrap_or(false) ||
@@ -653,10 +641,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::adjustment::AutoBorrow<'tcx> {
653641
}
654642
}
655643

656-
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
657-
folder.fold_autoref(self)
658-
}
659-
660644
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
661645
match *self {
662646
ty::adjustment::AutoBorrow::Ref(r, _m) => r.visit_with(visitor),

src/librustc/ty/subst.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,6 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx Substs<'tcx> {
320320
}
321321
}
322322

323-
fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
324-
folder.fold_substs(self)
325-
}
326-
327323
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
328324
self.iter().any(|t| t.visit_with(visitor))
329325
}

0 commit comments

Comments
 (0)