diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2019-11-13 21:48:13 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2019-11-13 21:48:13 +0100 |
| commit | 7214b9ad48b8ca5e117db88f0aeafe6a141500f7 (patch) | |
| tree | b606e4ecb626923bd2e680c5243572f298abff24 | |
| parent | d5f5e706ef84c85dc1d503365f2a61fa4ffcae7b (diff) | |
| download | rust-7214b9ad48b8ca5e117db88f0aeafe6a141500f7.tar.gz rust-7214b9ad48b8ca5e117db88f0aeafe6a141500f7.zip | |
Retire BraceStructTypeFoldableImpl and TupleStructTypeFoldableImpl.
| -rw-r--r-- | src/librustc/macros.rs | 54 | ||||
| -rw-r--r-- | src/librustc/ty/fold.rs | 3 |
2 files changed, 1 insertions, 56 deletions
diff --git a/src/librustc/macros.rs b/src/librustc/macros.rs index 256a08d7e90..2d0538ad8e0 100644 --- a/src/librustc/macros.rs +++ b/src/librustc/macros.rs @@ -325,60 +325,6 @@ macro_rules! EnumLiftImpl { } #[macro_export] -macro_rules! BraceStructTypeFoldableImpl { - (impl<$($p:tt),*> TypeFoldable<$tcx:tt> for $s:path { - $($field:ident),* $(,)? - } $(where $($wc:tt)*)*) => { - impl<$($p),*> $crate::ty::fold::TypeFoldable<$tcx> for $s - $(where $($wc)*)* - { - fn super_fold_with<V: $crate::ty::fold::TypeFolder<$tcx>>( - &self, - folder: &mut V, - ) -> Self { - let $s { $($field,)* } = self; - $s { $($field: $crate::ty::fold::TypeFoldable::fold_with($field, folder),)* } - } - - fn super_visit_with<V: $crate::ty::fold::TypeVisitor<$tcx>>( - &self, - visitor: &mut V, - ) -> bool { - let $s { $($field,)* } = self; - false $(|| $crate::ty::fold::TypeFoldable::visit_with($field, visitor))* - } - } - }; -} - -#[macro_export] -macro_rules! TupleStructTypeFoldableImpl { - (impl<$($p:tt),*> TypeFoldable<$tcx:tt> for $s:path { - $($field:ident),* $(,)? - } $(where $($wc:tt)*)*) => { - impl<$($p),*> $crate::ty::fold::TypeFoldable<$tcx> for $s - $(where $($wc)*)* - { - fn super_fold_with<V: $crate::ty::fold::TypeFolder<$tcx>>( - &self, - folder: &mut V, - ) -> Self { - let $s($($field,)*)= self; - $s($($crate::ty::fold::TypeFoldable::fold_with($field, folder),)*) - } - - fn super_visit_with<V: $crate::ty::fold::TypeVisitor<$tcx>>( - &self, - visitor: &mut V, - ) -> bool { - let $s($($field,)*) = self; - false $(|| $crate::ty::fold::TypeFoldable::visit_with($field, visitor))* - } - } - }; -} - -#[macro_export] macro_rules! EnumTypeFoldableImpl { (impl<$($p:tt),*> TypeFoldable<$tcx:tt> for $s:path { $($variants:tt)* diff --git a/src/librustc/ty/fold.rs b/src/librustc/ty/fold.rs index bacf3d42f04..02232fb7f9f 100644 --- a/src/librustc/ty/fold.rs +++ b/src/librustc/ty/fold.rs @@ -42,8 +42,7 @@ use crate::util::nodemap::FxHashSet; /// This trait is implemented for every type that can be folded. /// Basically, every type that has a corresponding method in `TypeFolder`. /// -/// To implement this conveniently, use the -/// `BraceStructTypeFoldableImpl` etc macros found in `macros.rs`. +/// To implement this conveniently, use the derive macro located in librustc_macros. pub trait TypeFoldable<'tcx>: fmt::Debug + Clone { fn super_fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self; fn fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self { |
