diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-05-20 17:52:05 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-06-01 08:59:47 +0300 |
| commit | c0e8fffcbfea1d61695acc143b514419826f5ac8 (patch) | |
| tree | 9af4bf74a0d4b1ec10babf122f968cbbfcad372c | |
| parent | 552ab37a100231f8f2416b5ecc7e350c17e6487f (diff) | |
| download | rust-c0e8fffcbfea1d61695acc143b514419826f5ac8.tar.gz rust-c0e8fffcbfea1d61695acc143b514419826f5ac8.zip | |
rustc: remove unused TypeFolder methods.
| -rw-r--r-- | src/librustc/ty/fold.rs | 27 | ||||
| -rw-r--r-- | src/librustc/ty/structural_impls.rs | 16 | ||||
| -rw-r--r-- | src/librustc/ty/subst.rs | 4 |
3 files changed, 0 insertions, 47 deletions
diff --git a/src/librustc/ty/fold.rs b/src/librustc/ty/fold.rs index c17a54f4f69..bb13031a2b7 100644 --- a/src/librustc/ty/fold.rs +++ b/src/librustc/ty/fold.rs @@ -39,8 +39,6 @@ //! These methods return true to indicate that the visitor has found what it is looking for //! and does not need to visit anything else. -use ty::subst::Substs; -use ty::adjustment; use ty::{self, Binder, Ty, TyCtxt, TypeFlags}; use std::fmt; @@ -138,34 +136,9 @@ pub trait TypeFolder<'gcx: 'tcx, 'tcx> : Sized { t.super_fold_with(self) } - fn fold_mt(&mut self, t: &ty::TypeAndMut<'tcx>) -> ty::TypeAndMut<'tcx> { - t.super_fold_with(self) - } - - fn fold_impl_header(&mut self, imp: &ty::ImplHeader<'tcx>) -> ty::ImplHeader<'tcx> { - imp.super_fold_with(self) - } - - fn fold_substs(&mut self, - substs: &'tcx Substs<'tcx>) - -> &'tcx Substs<'tcx> { - substs.super_fold_with(self) - } - - fn fold_fn_sig(&mut self, - sig: &ty::FnSig<'tcx>) - -> ty::FnSig<'tcx> { - sig.super_fold_with(self) - } - fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { r.super_fold_with(self) } - - fn fold_autoref(&mut self, ar: &adjustment::AutoBorrow<'tcx>) - -> adjustment::AutoBorrow<'tcx> { - ar.super_fold_with(self) - } } pub trait TypeVisitor<'tcx> : Sized { diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index 9336e7beae2..60dbbae90ca 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -532,10 +532,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::TypeAndMut<'tcx> { ty::TypeAndMut { ty: self.ty.fold_with(folder), mutbl: self.mutbl } } - fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self { - folder.fold_mt(self) - } - fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool { self.ty.visit_with(visitor) } @@ -552,10 +548,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::FnSig<'tcx> { } } - fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self { - folder.fold_fn_sig(self) - } - fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool { self.inputs().iter().any(|i| i.visit_with(visitor)) || self.output().visit_with(visitor) @@ -602,10 +594,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::ImplHeader<'tcx> { } } - fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self { - folder.fold_impl_header(self) - } - fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool { self.self_ty.visit_with(visitor) || 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> { } } - fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self { - folder.fold_autoref(self) - } - fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool { match *self { ty::adjustment::AutoBorrow::Ref(r, _m) => r.visit_with(visitor), diff --git a/src/librustc/ty/subst.rs b/src/librustc/ty/subst.rs index e23003bf772..d0d61323392 100644 --- a/src/librustc/ty/subst.rs +++ b/src/librustc/ty/subst.rs @@ -320,10 +320,6 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx Substs<'tcx> { } } - fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self { - folder.fold_substs(self) - } - fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool { self.iter().any(|t| t.visit_with(visitor)) } |
