From c8850c7144c0414d519cf2d9b2759de30a0fbe79 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sat, 30 Nov 2019 18:10:59 +0100 Subject: Make `ForeignItem` an alias of `Item`. --- src/libsyntax/ast.rs | 15 +++------------ src/libsyntax/mut_visit.rs | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 75ddf10514d..92ba071a03d 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -2488,14 +2488,14 @@ impl VariantData { /// /// The name might be a dummy name in case of anonymous items. #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] -pub struct Item { +pub struct Item { pub attrs: Vec, pub id: NodeId, pub span: Span, pub vis: Visibility, pub ident: Ident, - pub kind: ItemKind, + pub kind: K, /// Original tokens this item was parsed from. This isn't necessarily /// available for all items, although over time more and more items should @@ -2650,16 +2650,7 @@ impl ItemKind { } } -#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] -pub struct ForeignItem { - pub attrs: Vec, - pub id: NodeId, - pub span: Span, - pub vis: Visibility, - pub ident: Ident, - - pub kind: ForeignItemKind, -} +pub type ForeignItem = Item; /// An item within an `extern` block. #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 8889e5df26c..f8795d885d2 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -1053,7 +1053,7 @@ pub fn noop_flat_map_item(mut item: P, visitor: &mut T) pub fn noop_flat_map_foreign_item(mut item: ForeignItem, visitor: &mut T) -> SmallVec<[ForeignItem; 1]> { - let ForeignItem { ident, attrs, kind, id, span, vis } = &mut item; + let ForeignItem { ident, attrs, id, kind, vis, span, tokens: _ } = &mut item; visitor.visit_ident(ident); visit_attrs(attrs, visitor); match kind { -- cgit 1.4.1-3-g733a5