diff options
| author | varkor <github@varkor.com> | 2019-09-26 17:51:36 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-09-26 18:21:48 +0100 |
| commit | 7bc94cc3c2ccef8b4d393910bb978a6487db1202 (patch) | |
| tree | 1c7a5175d795992497651e7dfa3e3a0f76f5815a /src/libsyntax/ext | |
| parent | 21bf983acbb5d7ac8fb9462cbf2cc4c280abd857 (diff) | |
| download | rust-7bc94cc3c2ccef8b4d393910bb978a6487db1202.tar.gz rust-7bc94cc3c2ccef8b4d393910bb978a6487db1202.zip | |
Rename `Item.node` to `Item.kind`
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/mbe/macro_rules.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/placeholders.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/proc_macro.rs | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 692849eb8cf..54cfb80573e 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -222,7 +222,7 @@ impl Annotatable { pub fn derive_allowed(&self) -> bool { match *self { - Annotatable::Item(ref item) => match item.node { + Annotatable::Item(ref item) => match item.kind { ast::ItemKind::Struct(..) | ast::ItemKind::Enum(..) | ast::ItemKind::Union(..) => true, diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index a2a7571c440..6b93d045588 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -567,14 +567,14 @@ impl<'a> ExtCtxt<'a> { } pub fn item(&self, span: Span, name: Ident, - attrs: Vec<ast::Attribute>, node: ast::ItemKind) -> P<ast::Item> { + attrs: Vec<ast::Attribute>, kind: ast::ItemKind) -> P<ast::Item> { // FIXME: Would be nice if our generated code didn't violate // Rust coding conventions P(ast::Item { ident: name, attrs, id: ast::DUMMY_NODE_ID, - node, + kind, vis: respan(span.shrink_to_lo(), ast::VisibilityKind::Inherited), span, tokens: None, diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index d90839ac7fd..bc073a66795 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -293,7 +293,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { let krate_item = AstFragment::Items(smallvec![P(ast::Item { attrs: krate.attrs, span: krate.span, - node: ast::ItemKind::Mod(krate.module), + kind: ast::ItemKind::Mod(krate.module), ident: Ident::invalid(), id: ast::DUMMY_NODE_ID, vis: respan(krate.span.shrink_to_lo(), ast::VisibilityKind::Public), @@ -301,7 +301,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { })]); match self.fully_expand_fragment(krate_item).make_items().pop().map(P::into_inner) { - Some(ast::Item { attrs, node: ast::ItemKind::Mod(module), .. }) => { + Some(ast::Item { attrs, kind: ast::ItemKind::Mod(module), .. }) => { krate.attrs = attrs; krate.module = module; }, @@ -689,7 +689,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { fn gate_proc_macro_attr_item(&self, span: Span, item: &Annotatable) { let (kind, gate) = match *item { Annotatable::Item(ref item) => { - match item.node { + match item.kind { ItemKind::Mod(_) if self.cx.ecfg.proc_macro_hygiene() => return, ItemKind::Mod(_) => ("modules", sym::proc_macro_hygiene), _ => return, @@ -737,7 +737,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> { impl<'ast, 'a> Visitor<'ast> for DisallowMacros<'a> { fn visit_item(&mut self, i: &'ast ast::Item) { - if let ast::ItemKind::MacroDef(_) = i.node { + if let ast::ItemKind::MacroDef(_) = i.kind { emit_feature_err( self.parse_sess, sym::proc_macro_hygiene, @@ -1247,10 +1247,10 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> { AstFragmentKind::Items, after_derive).make_items(); } - match item.node { + match item.kind { ast::ItemKind::Mac(..) => { self.check_attributes(&item.attrs); - item.and_then(|item| match item.node { + item.and_then(|item| match item.kind { ItemKind::Mac(mac) => self.collect( AstFragmentKind::Items, InvocationKind::Bang { mac, span: item.span } ).make_items(), diff --git a/src/libsyntax/ext/mbe/macro_rules.rs b/src/libsyntax/ext/mbe/macro_rules.rs index c24f6a66603..aec4a683141 100644 --- a/src/libsyntax/ext/mbe/macro_rules.rs +++ b/src/libsyntax/ext/mbe/macro_rules.rs @@ -302,7 +302,7 @@ pub fn compile_declarative_macro( let tt_spec = ast::Ident::new(sym::tt, def.span); // Parse the macro_rules! invocation - let body = match def.node { + let body = match def.kind { ast::ItemKind::MacroDef(ref body) => body, _ => unreachable!(), }; diff --git a/src/libsyntax/ext/placeholders.rs b/src/libsyntax/ext/placeholders.rs index cb4c685dabe..a06de0f5517 100644 --- a/src/libsyntax/ext/placeholders.rs +++ b/src/libsyntax/ext/placeholders.rs @@ -48,7 +48,7 @@ pub fn placeholder(kind: AstFragmentKind, id: ast::NodeId) -> AstFragment { AstFragmentKind::OptExpr => AstFragment::OptExpr(Some(expr_placeholder())), AstFragmentKind::Items => AstFragment::Items(smallvec![P(ast::Item { id, span, ident, vis, attrs, - node: ast::ItemKind::Mac(mac_placeholder()), + kind: ast::ItemKind::Mac(mac_placeholder()), tokens: None, })]), AstFragmentKind::TraitItems => AstFragment::TraitItems(smallvec![ast::TraitItem { @@ -251,7 +251,7 @@ impl<'a, 'b> MutVisitor for PlaceholderExpander<'a, 'b> { } fn flat_map_item(&mut self, item: P<ast::Item>) -> SmallVec<[P<ast::Item>; 1]> { - match item.node { + match item.kind { ast::ItemKind::Mac(_) => return self.remove(item.id).make_items(), ast::ItemKind::MacroDef(_) => return smallvec![item], _ => {} @@ -337,7 +337,7 @@ impl<'a, 'b> MutVisitor for PlaceholderExpander<'a, 'b> { fn visit_mod(&mut self, module: &mut ast::Mod) { noop_visit_mod(module, self); - module.items.retain(|item| match item.node { + module.items.retain(|item| match item.kind { ast::ItemKind::Mac(_) if !self.cx.ecfg.keep_macs => false, // remove macro definitions _ => true, }); diff --git a/src/libsyntax/ext/proc_macro.rs b/src/libsyntax/ext/proc_macro.rs index 47b17ced816..e17bbf79fd5 100644 --- a/src/libsyntax/ext/proc_macro.rs +++ b/src/libsyntax/ext/proc_macro.rs @@ -107,7 +107,7 @@ impl MultiItemModifier for ProcMacroDerive { return Vec::new() } }; - match item.node { + match item.kind { ItemKind::Struct(..) | ItemKind::Enum(..) | ItemKind::Union(..) => {}, |
