Skip to content

Commit 7214b9a

Browse files
committed
Retire BraceStructTypeFoldableImpl and TupleStructTypeFoldableImpl.
1 parent d5f5e70 commit 7214b9a

File tree

2 files changed

+1
-56
lines changed

2 files changed

+1
-56
lines changed

src/librustc/macros.rs

-54
Original file line numberDiff line numberDiff line change
@@ -324,60 +324,6 @@ macro_rules! EnumLiftImpl {
324324
};
325325
}
326326

327-
#[macro_export]
328-
macro_rules! BraceStructTypeFoldableImpl {
329-
(impl<$($p:tt),*> TypeFoldable<$tcx:tt> for $s:path {
330-
$($field:ident),* $(,)?
331-
} $(where $($wc:tt)*)*) => {
332-
impl<$($p),*> $crate::ty::fold::TypeFoldable<$tcx> for $s
333-
$(where $($wc)*)*
334-
{
335-
fn super_fold_with<V: $crate::ty::fold::TypeFolder<$tcx>>(
336-
&self,
337-
folder: &mut V,
338-
) -> Self {
339-
let $s { $($field,)* } = self;
340-
$s { $($field: $crate::ty::fold::TypeFoldable::fold_with($field, folder),)* }
341-
}
342-
343-
fn super_visit_with<V: $crate::ty::fold::TypeVisitor<$tcx>>(
344-
&self,
345-
visitor: &mut V,
346-
) -> bool {
347-
let $s { $($field,)* } = self;
348-
false $(|| $crate::ty::fold::TypeFoldable::visit_with($field, visitor))*
349-
}
350-
}
351-
};
352-
}
353-
354-
#[macro_export]
355-
macro_rules! TupleStructTypeFoldableImpl {
356-
(impl<$($p:tt),*> TypeFoldable<$tcx:tt> for $s:path {
357-
$($field:ident),* $(,)?
358-
} $(where $($wc:tt)*)*) => {
359-
impl<$($p),*> $crate::ty::fold::TypeFoldable<$tcx> for $s
360-
$(where $($wc)*)*
361-
{
362-
fn super_fold_with<V: $crate::ty::fold::TypeFolder<$tcx>>(
363-
&self,
364-
folder: &mut V,
365-
) -> Self {
366-
let $s($($field,)*)= self;
367-
$s($($crate::ty::fold::TypeFoldable::fold_with($field, folder),)*)
368-
}
369-
370-
fn super_visit_with<V: $crate::ty::fold::TypeVisitor<$tcx>>(
371-
&self,
372-
visitor: &mut V,
373-
) -> bool {
374-
let $s($($field,)*) = self;
375-
false $(|| $crate::ty::fold::TypeFoldable::visit_with($field, visitor))*
376-
}
377-
}
378-
};
379-
}
380-
381327
#[macro_export]
382328
macro_rules! EnumTypeFoldableImpl {
383329
(impl<$($p:tt),*> TypeFoldable<$tcx:tt> for $s:path {

src/librustc/ty/fold.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ use crate::util::nodemap::FxHashSet;
4242
/// This trait is implemented for every type that can be folded.
4343
/// Basically, every type that has a corresponding method in `TypeFolder`.
4444
///
45-
/// To implement this conveniently, use the
46-
/// `BraceStructTypeFoldableImpl` etc macros found in `macros.rs`.
45+
/// To implement this conveniently, use the derive macro located in librustc_macros.
4746
pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
4847
fn super_fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self;
4948
fn fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Self {

0 commit comments

Comments
 (0)