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/deriving/clone.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax_ext/global_allocator.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/global_asm.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/plugin_macro_defs.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/proc_macro_harness.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/test.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax_ext/test_harness.rs | 10 |
8 files changed, 17 insertions, 17 deletions
diff --git a/src/libsyntax_ext/deriving/clone.rs b/src/libsyntax_ext/deriving/clone.rs index 9a4c540dc6f..9ef2c033b07 100644 --- a/src/libsyntax_ext/deriving/clone.rs +++ b/src/libsyntax_ext/deriving/clone.rs @@ -32,7 +32,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt<'_>, let is_shallow; match *item { Annotatable::Item(ref annitem) => { - match annitem.node { + match annitem.kind { ItemKind::Struct(_, Generics { ref params, .. }) | ItemKind::Enum(_, Generics { ref params, .. }) => { let container_id = cx.current_expansion.id.expn_data().parent; diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index b4306a1fd16..9f75f72e820 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -409,7 +409,7 @@ impl<'a> TraitDef<'a> { } false }); - let has_no_type_params = match item.node { + let has_no_type_params = match item.kind { ast::ItemKind::Struct(_, ref generics) | ast::ItemKind::Enum(_, ref generics) | ast::ItemKind::Union(_, ref generics) => { @@ -431,7 +431,7 @@ impl<'a> TraitDef<'a> { has_no_type_params; let use_temporaries = is_packed && is_always_copy; - let newitem = match item.node { + let newitem = match item.kind { ast::ItemKind::Struct(ref struct_def, ref generics) => { self.expand_struct_def(cx, &struct_def, item.ident, generics, from_scratch, use_temporaries) @@ -1780,7 +1780,7 @@ pub fn cs_fold1<F, B>(use_foldl: bool, /// (for an enum, no variant has any fields) pub fn is_type_without_fields(item: &Annotatable) -> bool { if let Annotatable::Item(ref item) = *item { - match item.node { + match item.kind { ast::ItemKind::Enum(ref enum_def, _) => { enum_def.variants.iter().all(|v| v.data.fields().is_empty()) } diff --git a/src/libsyntax_ext/global_allocator.rs b/src/libsyntax_ext/global_allocator.rs index 19a87e6dc6d..cd2a9b61a76 100644 --- a/src/libsyntax_ext/global_allocator.rs +++ b/src/libsyntax_ext/global_allocator.rs @@ -20,7 +20,7 @@ pub fn expand( vec![item] }; let item = match item { - Annotatable::Item(item) => match item.node { + Annotatable::Item(item) => match item.kind { ItemKind::Static(..) => item, _ => return not_static(Annotatable::Item(item)), } diff --git a/src/libsyntax_ext/global_asm.rs b/src/libsyntax_ext/global_asm.rs index c56b3f3fc80..72fb5b47c21 100644 --- a/src/libsyntax_ext/global_asm.rs +++ b/src/libsyntax_ext/global_asm.rs @@ -28,7 +28,7 @@ pub fn expand_global_asm<'cx>(cx: &'cx mut ExtCtxt<'_>, ident: ast::Ident::invalid(), attrs: Vec::new(), id: ast::DUMMY_NODE_ID, - node: ast::ItemKind::GlobalAsm(P(global_asm)), + kind: ast::ItemKind::GlobalAsm(P(global_asm)), vis: respan(sp.shrink_to_lo(), ast::VisibilityKind::Inherited), span: cx.with_def_site_ctxt(sp), tokens: None, diff --git a/src/libsyntax_ext/plugin_macro_defs.rs b/src/libsyntax_ext/plugin_macro_defs.rs index ccdc5bd81a0..315babceae3 100644 --- a/src/libsyntax_ext/plugin_macro_defs.rs +++ b/src/libsyntax_ext/plugin_macro_defs.rs @@ -28,7 +28,7 @@ fn plugin_macro_def(name: Name, span: Span) -> P<Item> { ident: Ident::new(name, span), attrs: vec![rustc_builtin_macro], id: DUMMY_NODE_ID, - node: ItemKind::MacroDef(MacroDef { tokens: TokenStream::new(trees), legacy: true }), + kind: ItemKind::MacroDef(MacroDef { tokens: TokenStream::new(trees), legacy: true }), vis: respan(span, VisibilityKind::Inherited), span: span, tokens: None, diff --git a/src/libsyntax_ext/proc_macro_harness.rs b/src/libsyntax_ext/proc_macro_harness.rs index f33c813d86c..9b53bcb841c 100644 --- a/src/libsyntax_ext/proc_macro_harness.rs +++ b/src/libsyntax_ext/proc_macro_harness.rs @@ -226,7 +226,7 @@ impl<'a> CollectProcMacros<'a> { impl<'a> Visitor<'a> for CollectProcMacros<'a> { fn visit_item(&mut self, item: &'a ast::Item) { - if let ast::ItemKind::MacroDef(..) = item.node { + if let ast::ItemKind::MacroDef(..) = item.kind { if self.is_proc_macro_crate && attr::contains_name(&item.attrs, sym::macro_export) { let msg = "cannot export macro_rules! macros from a `proc-macro` crate type currently"; @@ -238,7 +238,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { // we're just not interested in this item. // // If we find one, try to locate a `#[proc_macro_derive]` attribute on it. - let is_fn = match item.node { + let is_fn = match item.kind { ast::ItemKind::Fn(..) => true, _ => false, }; diff --git a/src/libsyntax_ext/test.rs b/src/libsyntax_ext/test.rs index a5d5ceb4b4f..5d68a92579f 100644 --- a/src/libsyntax_ext/test.rs +++ b/src/libsyntax_ext/test.rs @@ -78,7 +78,7 @@ pub fn expand_test_or_bench( "`#[test]` attribute is only allowed on non associated functions").raise(); }; - if let ast::ItemKind::Mac(_) = item.node { + if let ast::ItemKind::Mac(_) = item.kind { cx.parse_sess.span_diagnostic.span_warn(item.span, "`#[test]` attribute should not be used on macros. Use `#[cfg(test)]` instead."); return vec![Annotatable::Item(item)]; @@ -264,7 +264,7 @@ fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic { fn has_test_signature(cx: &ExtCtxt<'_>, i: &ast::Item) -> bool { let has_should_panic_attr = attr::contains_name(&i.attrs, sym::should_panic); let ref sd = cx.parse_sess.span_diagnostic; - if let ast::ItemKind::Fn(ref decl, ref header, ref generics, _) = i.node { + if let ast::ItemKind::Fn(ref decl, ref header, ref generics, _) = i.kind { if header.unsafety == ast::Unsafety::Unsafe { sd.span_err( i.span, @@ -315,7 +315,7 @@ fn has_test_signature(cx: &ExtCtxt<'_>, i: &ast::Item) -> bool { } fn has_bench_signature(cx: &ExtCtxt<'_>, i: &ast::Item) -> bool { - let has_sig = if let ast::ItemKind::Fn(ref decl, _, _, _) = i.node { + let has_sig = if let ast::ItemKind::Fn(ref decl, _, _, _) = i.kind { // N.B., inadequate check, but we're running // well before resolve, can't get too deep. decl.inputs.len() == 1 diff --git a/src/libsyntax_ext/test_harness.rs b/src/libsyntax_ext/test_harness.rs index 56de0c97f81..fc1daa7d9b2 100644 --- a/src/libsyntax_ext/test_harness.rs +++ b/src/libsyntax_ext/test_harness.rs @@ -85,7 +85,7 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> { // We don't want to recurse into anything other than mods, since // mods or tests inside of functions will break things - if let ast::ItemKind::Mod(mut module) = item.node { + if let ast::ItemKind::Mod(mut module) = item.kind { let tests = mem::take(&mut self.tests); noop_visit_mod(&mut module, self); let mut tests = mem::replace(&mut self.tests, tests); @@ -111,7 +111,7 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> { } self.cx.test_cases.extend(tests); } - item.node = ast::ItemKind::Mod(module); + item.kind = ast::ItemKind::Mod(module); } smallvec![P(item)] } @@ -142,7 +142,7 @@ impl MutVisitor for EntryPointCleaner { EntryPointType::MainNamed | EntryPointType::MainAttr | EntryPointType::Start => - item.map(|ast::Item {id, ident, attrs, node, vis, span, tokens}| { + item.map(|ast::Item {id, ident, attrs, kind, vis, span, tokens}| { let allow_ident = Ident::new(sym::allow, self.def_site); let dc_nested = attr::mk_nested_word_item( Ident::from_str_and_span("dead_code", self.def_site), @@ -159,7 +159,7 @@ impl MutVisitor for EntryPointCleaner { }) .chain(iter::once(allow_dead_code)) .collect(), - node, + kind, vis, span, tokens, @@ -295,7 +295,7 @@ fn mk_main(cx: &mut TestCtxt<'_>) -> P<ast::Item> { ident: main_id, attrs: vec![main_attr], id: ast::DUMMY_NODE_ID, - node: main, + kind: main, vis: respan(sp, ast::VisibilityKind::Public), span: sp, tokens: None, |
