]> git.lizzy.rs Git - rust.git/commitdiff
Rename `Item.node` to `Item.kind`
authorvarkor <github@varkor.com>
Thu, 26 Sep 2019 16:51:36 +0000 (17:51 +0100)
committervarkor <github@varkor.com>
Thu, 26 Sep 2019 17:21:48 +0000 (18:21 +0100)
99 files changed:
src/librustc/hir/check_attr.rs
src/librustc/hir/intravisit.rs
src/librustc/hir/lowering.rs
src/librustc/hir/lowering/item.rs
src/librustc/hir/map/blocks.rs
src/librustc/hir/map/collector.rs
src/librustc/hir/map/def_collector.rs
src/librustc/hir/map/mod.rs
src/librustc/hir/mod.rs
src/librustc/hir/print.rs
src/librustc/ich/impls_hir.rs
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/nice_region_error/find_anon_type.rs
src/librustc/infer/opaque_types/mod.rs
src/librustc/lint/context.rs
src/librustc/lint/internal.rs
src/librustc/middle/dead.rs
src/librustc/middle/entry.rs
src/librustc/middle/reachable.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/stability.rs
src/librustc/traits/error_reporting.rs
src/librustc/traits/util.rs
src/librustc/ty/context.rs
src/librustc/ty/mod.rs
src/librustc_codegen_llvm/consts.rs
src/librustc_codegen_ssa/back/symbol_export.rs
src/librustc_codegen_ssa/mono_item.rs
src/librustc_incremental/persist/dirty_clean.rs
src/librustc_lint/builtin.rs
src/librustc_lint/nonstandard_style.rs
src/librustc_lint/types.rs
src/librustc_lint/unused.rs
src/librustc_metadata/creader.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/encoder.rs
src/librustc_metadata/foreign_modules.rs
src/librustc_metadata/link_args.rs
src/librustc_metadata/native_libs.rs
src/librustc_mir/build/mod.rs
src/librustc_mir/monomorphize/collector.rs
src/librustc_mir/transform/check_unsafety.rs
src/librustc_passes/ast_validation.rs
src/librustc_passes/layout_test.rs
src/librustc_plugin/build.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/check_unused.rs
src/librustc_resolve/late.rs
src/librustc_resolve/lib.rs
src/librustc_save_analysis/dump_visitor.rs
src/librustc_save_analysis/lib.rs
src/librustc_save_analysis/sig.rs
src/librustc_traits/lowering/environment.rs
src/librustc_typeck/check/_match.rs
src/librustc_typeck/check/method/suggest.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/wfcheck.rs
src/librustc_typeck/check_unused.rs
src/librustc_typeck/coherence/builtin.rs
src/librustc_typeck/coherence/inherent_impls.rs
src/librustc_typeck/coherence/inherent_impls_overlap.rs
src/librustc_typeck/coherence/orphan.rs
src/librustc_typeck/coherence/unsafety.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/impl_wf_check.rs
src/librustc_typeck/lib.rs
src/librustc_typeck/outlives/implicit_infer.rs
src/librustc_typeck/outlives/mod.rs
src/librustc_typeck/variance/constraints.rs
src/librustc_typeck/variance/mod.rs
src/librustc_typeck/variance/terms.rs
src/librustdoc/clean/inline.rs
src/librustdoc/clean/mod.rs
src/librustdoc/test.rs
src/librustdoc/visit_ast.rs
src/libsyntax/ast.rs
src/libsyntax/entry.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/build.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/mbe/macro_rules.rs
src/libsyntax/ext/placeholders.rs
src/libsyntax/ext/proc_macro.rs
src/libsyntax/feature_gate/check.rs
src/libsyntax/mut_visit.rs
src/libsyntax/parse/diagnostics.rs
src/libsyntax/parse/parser/item.rs
src/libsyntax/parse/tests.rs
src/libsyntax/print/pprust.rs
src/libsyntax/visit.rs
src/libsyntax_ext/deriving/clone.rs
src/libsyntax_ext/deriving/generic/mod.rs
src/libsyntax_ext/global_allocator.rs
src/libsyntax_ext/global_asm.rs
src/libsyntax_ext/plugin_macro_defs.rs
src/libsyntax_ext/proc_macro_harness.rs
src/libsyntax_ext/test.rs
src/libsyntax_ext/test_harness.rs

index 8340c17b4b7a040f4ec33b544f87cb9a3362f587..c946118b1ea195ebb827067cc1bbd41d0aac2a46 100644 (file)
@@ -65,7 +65,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 
 impl Target {
     pub(crate) fn from_item(item: &hir::Item) -> Target {
-        match item.node {
+        match item.kind {
             hir::ItemKind::ExternCrate(..) => Target::ExternCrate,
             hir::ItemKind::Use(..) => Target::Use,
             hir::ItemKind::Static(..) => Target::Static,
@@ -333,7 +333,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
 }
 
 fn is_c_like_enum(item: &hir::Item) -> bool {
-    if let hir::ItemKind::Enum(ref def, _) = item.node {
+    if let hir::ItemKind::Enum(ref def, _) = item.kind {
         for variant in &def.variants {
             match variant.data {
                 hir::VariantData::Unit(..) => { /* continue */ }
index 188f3c537293f7485f1eba97d8210a6d16ba5827..3f6c7f22f16bee880a10920c906e710953bccfdf 100644 (file)
@@ -465,7 +465,7 @@ pub fn walk_param<'v, V: Visitor<'v>>(visitor: &mut V, param: &'v Param) {
 pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
     visitor.visit_vis(&item.vis);
     visitor.visit_ident(item.ident);
-    match item.node {
+    match item.kind {
         ItemKind::ExternCrate(orig_name) => {
             visitor.visit_id(item.hir_id);
             if let Some(orig_name) = orig_name {
index 24ea32b65ea23513b80d84d38ea7e30f3f93d6d4..d0a9d967a649d7037091f84bce2d0ccd9982cf3a 100644 (file)
@@ -437,7 +437,7 @@ fn visit_pat(&mut self, p: &'tcx Pat) {
             fn visit_item(&mut self, item: &'tcx Item) {
                 let hir_id = self.lctx.allocate_hir_id_counter(item.id);
 
-                match item.node {
+                match item.kind {
                     ItemKind::Struct(_, ref generics)
                     | ItemKind::Union(_, ref generics)
                     | ItemKind::Enum(_, ref generics)
@@ -1445,7 +1445,7 @@ fn generate_opaque_type(
             hir_id: opaque_ty_id,
             ident: Ident::invalid(),
             attrs: Default::default(),
-            node: opaque_ty_item_kind,
+            kind: opaque_ty_item_kind,
             vis: respan(span.shrink_to_lo(), hir::VisibilityKind::Inherited),
             span: opaque_ty_span,
         };
index 14311585652c352906313a0d626e52a3f7061730..ab477d6e1c19449b66bdf7e6e0c50cd4072b5e40 100644 (file)
@@ -73,7 +73,7 @@ fn visit_item(&mut self, item: &'tcx Item) {
         if let Some(hir_id) = item_hir_id {
             self.lctx.with_parent_item_lifetime_defs(hir_id, |this| {
                 let this = &mut ItemLowerer { lctx: this };
-                if let ItemKind::Impl(.., ref opt_trait_ref, _, _) = item.node {
+                if let ItemKind::Impl(.., ref opt_trait_ref, _, _) = item.kind {
                     this.with_trait_impl_ref(opt_trait_ref, |this| {
                         visit::walk_item(this, item)
                     });
@@ -119,7 +119,7 @@ fn with_parent_item_lifetime_defs<T>(
     ) -> T {
         let old_len = self.in_scope_lifetimes.len();
 
-        let parent_generics = match self.items.get(&parent_hir_id).unwrap().node {
+        let parent_generics = match self.items.get(&parent_hir_id).unwrap().kind {
             hir::ItemKind::Impl(_, _, _, ref generics, ..)
             | hir::ItemKind::Trait(_, _, ref generics, ..) => {
                 &generics.params[..]
@@ -168,7 +168,7 @@ pub(super) fn lower_mod(&mut self, m: &Mod) -> hir::Mod {
     }
 
     pub(super) fn lower_item_id(&mut self, i: &Item) -> SmallVec<[hir::ItemId; 1]> {
-        let node_ids = match i.node {
+        let node_ids = match i.kind {
             ItemKind::Use(ref use_tree) => {
                 let mut vec = smallvec![i.id];
                 self.lower_item_id_use_tree(use_tree, i.id, &mut vec);
@@ -235,7 +235,7 @@ pub fn lower_item(&mut self, i: &Item) -> Option<hir::Item> {
         }
         let attrs = attrs.into();
 
-        if let ItemKind::MacroDef(ref def) = i.node {
+        if let ItemKind::MacroDef(ref def) = i.kind {
             if !def.legacy || attr::contains_name(&i.attrs, sym::macro_export) {
                 let body = self.lower_token_stream(def.stream());
                 let hir_id = self.lower_node_id(i.id);
@@ -254,13 +254,13 @@ pub fn lower_item(&mut self, i: &Item) -> Option<hir::Item> {
             return None;
         }
 
-        let node = self.lower_item_kind(i.id, &mut ident, &attrs, &mut vis, &i.node);
+        let kind = self.lower_item_kind(i.id, &mut ident, &attrs, &mut vis, &i.kind);
 
         Some(hir::Item {
             hir_id: self.lower_node_id(i.id),
             ident,
             attrs,
-            node,
+            kind,
             vis,
             span: i.span,
         })
@@ -542,7 +542,7 @@ fn lower_use_tree(
                         let res = this.lower_res(res);
                         let path =
                             this.lower_path_extra(res, &path, ParamMode::Explicit, None);
-                        let item = hir::ItemKind::Use(P(path), hir::UseKind::Single);
+                        let kind = hir::ItemKind::Use(P(path), hir::UseKind::Single);
                         let vis = this.rebuild_vis(&vis);
 
                         this.insert_item(
@@ -550,7 +550,7 @@ fn lower_use_tree(
                                 hir_id: new_id,
                                 ident,
                                 attrs: attrs.into_iter().cloned().collect(),
-                                node: item,
+                                kind,
                                 vis,
                                 span,
                             },
@@ -558,8 +558,7 @@ fn lower_use_tree(
                     });
                 }
 
-                let path =
-                    P(self.lower_path_extra(ret_res, &path, ParamMode::Explicit, None));
+                let path = P(self.lower_path_extra(ret_res, &path, ParamMode::Explicit, None));
                 hir::ItemKind::Use(path, hir::UseKind::Single)
             }
             UseTreeKind::Glob => {
@@ -623,7 +622,7 @@ fn lower_use_tree(
                         let mut vis = this.rebuild_vis(&vis);
                         let mut ident = *ident;
 
-                        let item = this.lower_use_tree(use_tree,
+                        let kind = this.lower_use_tree(use_tree,
                                                        &prefix,
                                                        id,
                                                        &mut vis,
@@ -635,7 +634,7 @@ fn lower_use_tree(
                                 hir_id: new_hir_id,
                                 ident,
                                 attrs: attrs.into_iter().cloned().collect(),
-                                node: item,
+                                kind,
                                 vis,
                                 span: use_tree.span,
                             },
index a6da2e92df168add2b874f04672d5c3c53962370..f670d5abe85e4b59f05fd53c9d8bd22df403d395 100644 (file)
@@ -37,7 +37,10 @@ pub struct FnLikeNode<'a> { node: Node<'a> }
 
 impl MaybeFnLike for ast::Item {
     fn is_fn_like(&self) -> bool {
-        match self.node { ast::ItemKind::Fn(..) => true, _ => false, }
+        match self.kind {
+            ast::ItemKind::Fn(..) => true,
+            _ => false,
+        }
     }
 }
 
@@ -215,7 +218,7 @@ fn handle<A, I, M, C>(self, item_fn: I, method: M, closure: C) -> A where
         C: FnOnce(ClosureParts<'a>) -> A,
     {
         match self.node {
-            map::Node::Item(i) => match i.node {
+            map::Node::Item(i) => match i.kind {
                 ast::ItemKind::Fn(ref decl, header, ref generics, block) =>
                     item_fn(ItemFnParts {
                         id: i.hir_id,
index 815a239405cdc3f1642e96e4951d2a40e6f59486..c69d682b6f796462633036a553566daa87e20ab7 100644 (file)
@@ -378,7 +378,7 @@ fn visit_item(&mut self, i: &'hir Item) {
         self.with_dep_node_owner(i.hir_id.owner, i, |this| {
             this.insert(i.span, i.hir_id, Node::Item(i));
             this.with_parent(i.hir_id, |this| {
-                if let ItemKind::Struct(ref struct_def, _) = i.node {
+                if let ItemKind::Struct(ref struct_def, _) = i.kind {
                     // If this is a tuple or unit-like struct, register the constructor.
                     if let Some(ctor_hir_id) = struct_def.ctor_hir_id() {
                         this.insert(i.span, ctor_hir_id, Node::Ctor(struct_def));
index 74137f81bf88c1f39d04bd4c8e8fd0f65b7a115c..4235da76f538bcc365abca0a25c30092150feb9f 100644 (file)
@@ -101,7 +101,7 @@ fn visit_item(&mut self, i: &'a Item) {
 
         // Pick the def data. This need not be unique, but the more
         // information we encapsulate into, the better
-        let def_data = match i.node {
+        let def_data = match i.kind {
             ItemKind::Impl(..) => DefPathData::Impl,
             ItemKind::Mod(..) if i.ident.name == kw::Invalid => {
                 return visit::walk_item(self, i);
@@ -138,7 +138,7 @@ fn visit_item(&mut self, i: &'a Item) {
         let def = self.create_def(i.id, def_data, i.span);
 
         self.with_parent(def, |this| {
-            match i.node {
+            match i.kind {
                 ItemKind::Struct(ref struct_def, _) | ItemKind::Union(ref struct_def, _) => {
                     // If this is a unit or tuple-like struct, register the constructor.
                     if let Some(ctor_hir_id) = struct_def.ctor_id() {
index 2d319a64d4d72975ae36765ff01948a46f17ae66..c13bb3cb1f2dd12eed2ec668dbfc941699956366 100644 (file)
@@ -50,7 +50,7 @@ fn parent_node(self) -> Option<HirId> {
     fn fn_decl(&self) -> Option<&'hir FnDecl> {
         match self.node {
             Node::Item(ref item) => {
-                match item.node {
+                match item.kind {
                     ItemKind::Fn(ref fn_decl, _, _, _) => Some(fn_decl),
                     _ => None,
                 }
@@ -84,7 +84,7 @@ fn fn_decl(&self) -> Option<&'hir FnDecl> {
     fn associated_body(self) -> Option<BodyId> {
         match self.node {
             Node::Item(item) => {
-                match item.node {
+                match item.kind {
                     ItemKind::Const(_, body) |
                     ItemKind::Static(.., body) |
                     ItemKind::Fn(_, _, _, body) => Some(body),
@@ -293,7 +293,7 @@ pub fn def_kind(&self, hir_id: HirId) -> Option<DefKind> {
 
         Some(match node {
             Node::Item(item) => {
-                match item.node {
+                match item.kind {
                     ItemKind::Static(..) => DefKind::Static,
                     ItemKind::Const(..) => DefKind::Const,
                     ItemKind::Fn(..) => DefKind::Fn,
@@ -453,19 +453,19 @@ pub fn body_owned_by(&self, id: HirId) -> BodyId {
 
     pub fn body_owner_kind(&self, id: HirId) -> BodyOwnerKind {
         match self.get(id) {
-            Node::Item(&Item { node: ItemKind::Const(..), .. }) |
+            Node::Item(&Item { kind: ItemKind::Const(..), .. }) |
             Node::TraitItem(&TraitItem { kind: TraitItemKind::Const(..), .. }) |
             Node::ImplItem(&ImplItem { kind: ImplItemKind::Const(..), .. }) |
             Node::AnonConst(_) => {
                 BodyOwnerKind::Const
             }
             Node::Ctor(..) |
-            Node::Item(&Item { node: ItemKind::Fn(..), .. }) |
+            Node::Item(&Item { kind: ItemKind::Fn(..), .. }) |
             Node::TraitItem(&TraitItem { kind: TraitItemKind::Method(..), .. }) |
             Node::ImplItem(&ImplItem { kind: ImplItemKind::Method(..), .. }) => {
                 BodyOwnerKind::Fn
             }
-            Node::Item(&Item { node: ItemKind::Static(_, m, _), .. }) => {
+            Node::Item(&Item { kind: ItemKind::Static(_, m, _), .. }) => {
                 BodyOwnerKind::Static(m)
             }
             Node::Expr(&Expr { kind: ExprKind::Closure(..), .. }) => {
@@ -477,8 +477,8 @@ pub fn body_owner_kind(&self, id: HirId) -> BodyOwnerKind {
 
     pub fn ty_param_owner(&self, id: HirId) -> HirId {
         match self.get(id) {
-            Node::Item(&Item { node: ItemKind::Trait(..), .. }) |
-            Node::Item(&Item { node: ItemKind::TraitAlias(..), .. }) => id,
+            Node::Item(&Item { kind: ItemKind::Trait(..), .. }) |
+            Node::Item(&Item { kind: ItemKind::TraitAlias(..), .. }) => id,
             Node::GenericParam(_) => self.get_parent_node(id),
             _ => bug!("ty_param_owner: {} not a type parameter", self.node_to_string(id))
         }
@@ -486,8 +486,8 @@ pub fn ty_param_owner(&self, id: HirId) -> HirId {
 
     pub fn ty_param_name(&self, id: HirId) -> Name {
         match self.get(id) {
-            Node::Item(&Item { node: ItemKind::Trait(..), .. }) |
-            Node::Item(&Item { node: ItemKind::TraitAlias(..), .. }) => kw::SelfUpper,
+            Node::Item(&Item { kind: ItemKind::Trait(..), .. }) |
+            Node::Item(&Item { kind: ItemKind::TraitAlias(..), .. }) => kw::SelfUpper,
             Node::GenericParam(param) => param.name.ident().name,
             _ => bug!("ty_param_name: {} not a type parameter", self.node_to_string(id)),
         }
@@ -517,7 +517,7 @@ pub fn get_module(&self, module: DefId) -> (&'hir Mod, Span, HirId) {
         match self.find_entry(hir_id).unwrap().node {
             Node::Item(&Item {
                 span,
-                node: ItemKind::Mod(ref m),
+                kind: ItemKind::Mod(ref m),
                 ..
             }) => (m, span, hir_id),
             Node::Crate => (&self.forest.krate.module, self.forest.krate.span, hir_id),
@@ -568,7 +568,7 @@ pub fn get_generics(&self, id: DefId) -> Option<&'hir Generics> {
                 Node::ImplItem(ref impl_item) => Some(&impl_item.generics),
                 Node::TraitItem(ref trait_item) => Some(&trait_item.generics),
                 Node::Item(ref item) => {
-                    match item.node {
+                    match item.kind {
                         ItemKind::Fn(_, _, ref generics, _) |
                         ItemKind::TyAlias(_, ref generics) |
                         ItemKind::Enum(_, ref generics) |
@@ -649,7 +649,7 @@ pub fn is_const_context(&self, hir_id: HirId) -> bool {
         let parent_id = self.get_parent_item(hir_id);
         match self.get(parent_id) {
             Node::Item(&Item {
-                node: ItemKind::Const(..),
+                kind: ItemKind::Const(..),
                 ..
             })
             | Node::TraitItem(&TraitItem {
@@ -662,11 +662,11 @@ pub fn is_const_context(&self, hir_id: HirId) -> bool {
             })
             | Node::AnonConst(_)
             | Node::Item(&Item {
-                node: ItemKind::Static(..),
+                kind: ItemKind::Static(..),
                 ..
             }) => true,
             Node::Item(&Item {
-                node: ItemKind::Fn(_, header, ..),
+                kind: ItemKind::Fn(_, header, ..),
                 ..
             }) => header.constness == Constness::Const,
             _ => false,
@@ -676,7 +676,7 @@ pub fn is_const_context(&self, hir_id: HirId) -> bool {
     /// Wether `hir_id` corresponds to a `mod` or a crate.
     pub fn is_hir_id_module(&self, hir_id: HirId) -> bool {
         match self.lookup(hir_id) {
-            Some(Entry { node: Node::Item(Item { node: ItemKind::Mod(_), .. }), .. }) |
+            Some(Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. }) |
             Some(Entry { node: Node::Crate, .. }) => true,
             _ => false,
         }
@@ -796,7 +796,7 @@ pub fn get_module_parent(&self, id: HirId) -> DefId {
     /// module parent is in this map.
     pub fn get_module_parent_node(&self, hir_id: HirId) -> HirId {
         match self.walk_parent_nodes(hir_id, |node| match *node {
-            Node::Item(&Item { node: ItemKind::Mod(_), .. }) => true,
+            Node::Item(&Item { kind: ItemKind::Mod(_), .. }) => true,
             _ => false,
         }, |_| false) {
             Ok(id) => id,
@@ -808,7 +808,7 @@ pub fn get_module_parent_node(&self, hir_id: HirId) -> HirId {
     pub fn get_enclosing_scope(&self, hir_id: HirId) -> Option<HirId> {
         self.walk_parent_nodes(hir_id, |node| match *node {
             Node::Item(i) => {
-                match i.node {
+                match i.kind {
                     ItemKind::Fn(..)
                     | ItemKind::Mod(..)
                     | ItemKind::Enum(..)
@@ -852,7 +852,7 @@ pub fn get_defining_scope(&self, id: HirId) -> Option<HirId> {
             }
             match self.get(scope) {
                 Node::Item(i) => {
-                    match i.node {
+                    match i.kind {
                         ItemKind::OpaqueTy(OpaqueTy { impl_trait_fn: None, .. }) => {}
                         _ => break,
                     }
@@ -872,7 +872,7 @@ pub fn get_foreign_abi(&self, hir_id: HirId) -> Abi {
         let parent = self.get_parent_item(hir_id);
         if let Some(entry) = self.find_entry(parent) {
             if let Entry {
-                node: Node::Item(Item { node: ItemKind::ForeignMod(ref nm), .. }), .. } = entry
+                node: Node::Item(Item { kind: ItemKind::ForeignMod(ref nm), .. }), .. } = entry
             {
                 self.read(hir_id); // reveals some of the content of a node
                 return nm.abi;
@@ -905,7 +905,7 @@ pub fn expect_trait_item(&self, id: HirId) -> &'hir TraitItem {
     pub fn expect_variant_data(&self, id: HirId) -> &'hir VariantData {
         match self.find(id) {
             Some(Node::Item(i)) => {
-                match i.node {
+                match i.kind {
                     ItemKind::Struct(ref struct_def, _) |
                     ItemKind::Union(ref struct_def, _) => struct_def,
                     _ => bug!("struct ID bound to non-struct {}", self.node_to_string(id))
@@ -1123,7 +1123,7 @@ fn find_first_mod_parent(map: &Map<'_>, mut id: HirId) -> Option<(HirId, Name)>
             }
 
             fn item_is_mod(item: &Item) -> bool {
-                match item.node {
+                match item.kind {
                     ItemKind::Mod(_) => true,
                     _ => false,
                 }
@@ -1286,7 +1286,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
 
     match map.find(id) {
         Some(Node::Item(item)) => {
-            let item_str = match item.node {
+            let item_str = match item.kind {
                 ItemKind::ExternCrate(..) => "extern crate",
                 ItemKind::Use(..) => "use",
                 ItemKind::Static(..) => "static",
index e5cc045d38cb4e738984f9811388417c090b657a..abb4a88d04c96bdff641c3eb8abf021f26f086ab 100644 (file)
@@ -2416,7 +2416,7 @@ pub struct Item {
     pub ident: Ident,
     pub hir_id: HirId,
     pub attrs: HirVec<Attribute>,
-    pub node: ItemKind,
+    pub kind: ItemKind,
     pub vis: Visibility,
     pub span: Span,
 }
index 2c2884e102030ec1ca65fefc8e70ba23093046f5..de9a458c06fcb27732b978d4286ac107538da883 100644 (file)
@@ -474,7 +474,7 @@ pub fn print_item(&mut self, item: &hir::Item) {
         self.maybe_print_comment(item.span.lo());
         self.print_outer_attributes(&item.attrs);
         self.ann.pre(self, AnnNode::Item(item));
-        match item.node {
+        match item.kind {
             hir::ItemKind::ExternCrate(orig_name) => {
                 self.head(visibility_qualified(&item.vis, "extern crate"));
                 if let Some(orig_name) = orig_name {
index c92a9e97d22c4c108391bb8123961d6802187055..8e74f1e11eb511b23719a5157bfb5baceda3e908 100644 (file)
@@ -312,7 +312,7 @@ fn hash_stable<W: StableHasherResult>(&self,
             ident,
             ref attrs,
             hir_id: _,
-            ref node,
+            ref kind,
             ref vis,
             span
         } = *self;
@@ -320,7 +320,7 @@ fn hash_stable<W: StableHasherResult>(&self,
         hcx.hash_hir_item_like(|hcx| {
             ident.name.hash_stable(hcx, hasher);
             attrs.hash_stable(hcx, hasher);
-            node.hash_stable(hcx, hasher);
+            kind.hash_stable(hcx, hasher);
             vis.hash_stable(hcx, hasher);
             span.hash_stable(hcx, hasher);
         });
index 58164fbe146813ce75e92f11c23301f5ef32ffcb..d31b527a55b6951e6e4663744a6e52b9ba98cba5 100644 (file)
@@ -248,7 +248,7 @@ fn emit_msg_span(
     }
 
     fn item_scope_tag(item: &hir::Item) -> &'static str {
-        match item.node {
+        match item.kind {
             hir::ItemKind::Impl(..) => "impl",
             hir::ItemKind::Struct(..) => "struct",
             hir::ItemKind::Union(..) => "union",
index 42017a2358166e38718ed7487011f102feb3a3a3..9c362a5e20791973fa3d360b6d26b6211fe7c63f 100644 (file)
@@ -31,7 +31,7 @@ pub(super) fn find_anon_type(
             if let Some(hir_id) = self.tcx().hir().as_local_hir_id(def_id) {
                 let fndecl = match self.tcx().hir().get(hir_id) {
                     Node::Item(&hir::Item {
-                        node: hir::ItemKind::Fn(ref fndecl, ..),
+                        kind: hir::ItemKind::Fn(ref fndecl, ..),
                         ..
                     }) => &fndecl,
                     Node::TraitItem(&hir::TraitItem {
index 02b641a8519a5a45666628635d8c7e3220d5270c..3b3649fd8112fce75ae0a4489c7ceb1a6e1e1e91 100644 (file)
@@ -1036,7 +1036,7 @@ fn instantiate_opaque_types_in_map<T: TypeFoldable<'tcx>>(&mut self, value: &T)
                                                 .local_def_id(opaque_parent_hir_id)
                         };
                         let (in_definition_scope, origin) = match tcx.hir().find(opaque_hir_id) {
-                            Some(Node::Item(item)) => match item.node {
+                            Some(Node::Item(item)) => match item.kind {
                                 // Anonymous `impl Trait`
                                 hir::ItemKind::OpaqueTy(hir::OpaqueTy {
                                     impl_trait_fn: Some(parent),
index 3483efbd8408f26be6c983ab84ace908803dcf55..fa73a3c6c4628bb1ee29573913a7f0a44b4f10d7 100644 (file)
@@ -981,7 +981,7 @@ fn visit_body(&mut self, body: &'tcx hir::Body) {
 
     fn visit_item(&mut self, it: &'tcx hir::Item) {
         let generics = self.context.generics.take();
-        self.context.generics = it.node.generics();
+        self.context.generics = it.kind.generics();
         self.with_lint_attrs(it.hir_id, &it.attrs, |cx| {
             cx.with_param_env(it.hir_id, |cx| {
                 lint_callback!(cx, check_item, it);
index f0271db54f6b90a995c346095a425220c18cadba..a08722e940295b137e326cf530523097a1777210 100644 (file)
@@ -218,7 +218,7 @@ fn gen_args(segment: &PathSegment) -> String {
 
 impl EarlyLintPass for LintPassImpl {
     fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
-        if let ItemKind::Impl(_, _, _, _, Some(lint_pass), _, _) = &item.node {
+        if let ItemKind::Impl(_, _, _, _, Some(lint_pass), _, _) = &item.kind {
             if let Some(last) = lint_pass.path.segments.last() {
                 if last.ident.name == sym::LintPass {
                     let expn_data = lint_pass.path.span.ctxt().outer_expn_data();
index 7d0b7e8e7e8ee2bd13fa94120ea5aab706d58dd6..845f214106b5c5334f3ec3539092d2998208dc5b 100644 (file)
@@ -166,7 +166,7 @@ fn visit_node(&mut self, node: Node<'tcx>) {
         self.inherited_pub_visibility = false;
         match node {
             Node::Item(item) => {
-                match item.node {
+                match item.kind {
                     hir::ItemKind::Struct(..) | hir::ItemKind::Union(..) => {
                         let def_id = self.tcx.hir().local_def_id(item.hir_id);
                         let def = self.tcx.adt_def(def_id);
@@ -369,7 +369,7 @@ fn visit_item(&mut self, item: &hir::Item) {
         if allow_dead_code {
             self.worklist.push(item.hir_id);
         }
-        match item.node {
+        match item.kind {
             hir::ItemKind::Enum(ref enum_def, _) => {
                 if allow_dead_code {
                     self.worklist.extend(enum_def.variants.iter().map(|variant| variant.id));
@@ -482,7 +482,7 @@ struct DeadVisitor<'tcx> {
 
 impl DeadVisitor<'tcx> {
     fn should_warn_about_item(&mut self, item: &hir::Item) -> bool {
-        let should_warn = match item.node {
+        let should_warn = match item.kind {
             hir::ItemKind::Static(..)
             | hir::ItemKind::Const(..)
             | hir::ItemKind::Fn(..)
@@ -571,7 +571,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
         if self.should_warn_about_item(item) {
             // For items that have a definition with a signature followed by a
             // block, point only at the signature.
-            let span = match item.node {
+            let span = match item.kind {
                 hir::ItemKind::Fn(..) |
                 hir::ItemKind::Mod(..) |
                 hir::ItemKind::Enum(..) |
@@ -581,7 +581,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
                 hir::ItemKind::Impl(..) => self.tcx.sess.source_map().def_span(item.span),
                 _ => item.span,
             };
-            let participle = match item.node {
+            let participle = match item.kind {
                 hir::ItemKind::Struct(..) => "constructed", // Issue #52325
                 _ => "used"
             };
@@ -589,7 +589,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
                 item.hir_id,
                 span,
                 item.ident.name,
-                item.node.descriptive_variant(),
+                item.kind.descriptive_variant(),
                 participle,
             );
         } else {
index ba27d332e43f784d08084de10aa3843858fce99e..660fe14ba07001c4a143ccd7817c439dd08e2bd6 100644 (file)
@@ -80,7 +80,7 @@ fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(DefId, EntryFnType)> {
 // Beware, this is duplicated in `libsyntax/entry.rs`, so make sure to keep
 // them in sync.
 fn entry_point_type(item: &Item, at_root: bool) -> EntryPointType {
-    match item.node {
+    match item.kind {
         ItemKind::Fn(..) => {
             if attr::contains_name(&item.attrs, sym::start) {
                 EntryPointType::Start
index 061a1f62918bba4e87980e17c3e2dba056b04651..8be64bf64b5e91c8bcc3d07751c45396fced3621 100644 (file)
@@ -32,7 +32,7 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item, attrs: CodegenFnAt
         return true
     }
 
-    match item.node {
+    match item.kind {
         hir::ItemKind::Fn(_, header, ..) if header.is_const() => {
             return true;
         }
@@ -157,7 +157,7 @@ fn def_id_represents_local_inlined_item(&self, def_id: DefId) -> bool {
 
         match self.tcx.hir().find(hir_id) {
             Some(Node::Item(item)) => {
-                match item.node {
+                match item.kind {
                     hir::ItemKind::Fn(..) =>
                         item_might_be_inlined(self.tcx, &item, self.tcx.codegen_fn_attrs(def_id)),
                     _ => false,
@@ -187,7 +187,7 @@ fn def_id_represents_local_inlined_item(&self, def_id: DefId) -> bool {
                             // type of the impl require inlining, this method
                             // does too.
                             let impl_hir_id = self.tcx.hir().as_local_hir_id(impl_did).unwrap();
-                            match self.tcx.hir().expect_item(impl_hir_id).node {
+                            match self.tcx.hir().expect_item(impl_hir_id).kind {
                                 hir::ItemKind::Impl(..) => {
                                     let generics = self.tcx.generics_of(impl_did);
                                     generics.requires_monomorphization(self.tcx)
@@ -225,7 +225,7 @@ fn propagate_node(&mut self, node: &Node<'tcx>,
             // If we are building an executable, only explicitly extern
             // types need to be exported.
             if let Node::Item(item) = *node {
-                let reachable = if let hir::ItemKind::Fn(_, header, ..) = item.node {
+                let reachable = if let hir::ItemKind::Fn(_, header, ..) = item.kind {
                     header.abi != Abi::Rust
                 } else {
                     false
@@ -249,7 +249,7 @@ fn propagate_node(&mut self, node: &Node<'tcx>,
 
         match *node {
             Node::Item(item) => {
-                match item.node {
+                match item.kind {
                     hir::ItemKind::Fn(.., body) => {
                         let def_id = self.tcx.hir().local_def_id(item.hir_id);
                         if item_might_be_inlined(self.tcx,
@@ -361,7 +361,7 @@ fn visit_item(&mut self, item: &hir::Item) {
         }
 
         // We need only trait impls here, not inherent impls, and only non-exported ones
-        if let hir::ItemKind::Impl(.., Some(ref trait_ref), _, ref impl_item_refs) = item.node {
+        if let hir::ItemKind::Impl(.., Some(ref trait_ref), _, ref impl_item_refs) = item.kind {
             if !self.access_levels.is_reachable(item.hir_id) {
                 self.worklist.extend(impl_item_refs.iter().map(|ii_ref| ii_ref.id.hir_id));
 
index 875d0d7dd02c139c12e58bb4fd26b5c0c4b24aee..8340df4fecfac5b5d5c23682f8a954d6a0b92614 100644 (file)
@@ -459,7 +459,7 @@ fn visit_nested_body(&mut self, body: hir::BodyId) {
     }
 
     fn visit_item(&mut self, item: &'tcx hir::Item) {
-        match item.node {
+        match item.kind {
             hir::ItemKind::Fn(ref decl, _, ref generics, _) => {
                 self.visit_early_late(None, decl, generics, |this| {
                     intravisit::walk_item(this, item);
@@ -504,12 +504,12 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
             | hir::ItemKind::Impl(_, _, _, ref generics, ..) => {
                 // Impls permit `'_` to be used and it is equivalent to "some fresh lifetime name".
                 // This is not true for other kinds of items.x
-                let track_lifetime_uses = match item.node {
+                let track_lifetime_uses = match item.kind {
                     hir::ItemKind::Impl(..) => true,
                     _ => false,
                 };
                 // These kinds of items have only early-bound lifetime parameters.
-                let mut index = if sub_items_have_self_param(&item.node) {
+                let mut index = if sub_items_have_self_param(&item.kind) {
                     1 // Self comes before lifetimes
                 } else {
                     0
@@ -637,8 +637,7 @@ fn visit_ty(&mut self, ty: &'tcx hir::Ty) {
                 // `type MyAnonTy<'b> = impl MyTrait<'b>;`
                 //                 ^                  ^ this gets resolved in the scope of
                 //                                      the opaque_ty generics
-                let (generics, bounds) = match self.tcx.hir().expect_item(item_id.id).node
-                {
+                let (generics, bounds) = match self.tcx.hir().expect_item(item_id.id).kind {
                     // Named opaque `impl Trait` types are reached via `TyKind::Path`.
                     // This arm is for `impl Trait` in the types of statics, constants and locals.
                     hir::ItemKind::OpaqueTy(hir::OpaqueTy {
@@ -1263,7 +1262,7 @@ fn check_if_label_shadows_lifetime(
 fn compute_object_lifetime_defaults(tcx: TyCtxt<'_>) -> HirIdMap<Vec<ObjectLifetimeDefault>> {
     let mut map = HirIdMap::default();
     for item in tcx.hir().krate().items.values() {
-        match item.node {
+        match item.kind {
             hir::ItemKind::Struct(_, ref generics)
             | hir::ItemKind::Union(_, ref generics)
             | hir::ItemKind::Enum(_, ref generics)
@@ -1525,7 +1524,7 @@ fn suggest_eliding_single_use_lifetime(
             {
                 match parent {
                     Node::Item(item) => {
-                        if let hir::ItemKind::Fn(decl, _, _, _) = &item.node {
+                        if let hir::ItemKind::Fn(decl, _, _, _) = &item.kind {
                             find_arg_use_span(&decl.inputs);
                         }
                     },
@@ -1733,10 +1732,10 @@ fn visit_early_late<F>(
         let mut index = 0;
         if let Some(parent_id) = parent_id {
             let parent = self.tcx.hir().expect_item(parent_id);
-            if sub_items_have_self_param(&parent.node) {
+            if sub_items_have_self_param(&parent.kind) {
                 index += 1; // Self comes before lifetimes
             }
-            match parent.node {
+            match parent.kind {
                 hir::ItemKind::Trait(_, _, ref generics, ..)
                 | hir::ItemKind::Impl(_, _, _, ref generics, ..) => {
                     index += generics.params.len() as u32;
@@ -1867,7 +1866,7 @@ fn resolve_lifetime_ref(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
                 let fn_id = self.tcx.hir().body_owner(body_id);
                 match self.tcx.hir().get(fn_id) {
                     Node::Item(&hir::Item {
-                        node: hir::ItemKind::Fn(..),
+                        kind: hir::ItemKind::Fn(..),
                         ..
                     })
                     | Node::TraitItem(&hir::TraitItem {
@@ -2165,7 +2164,7 @@ fn visit_fn_like_elision(&mut self, inputs: &'tcx [hir::Ty], output: Option<&'tc
         let body = match self.tcx.hir().get(parent) {
             // `fn` definitions and methods.
             Node::Item(&hir::Item {
-                node: hir::ItemKind::Fn(.., body),
+                kind: hir::ItemKind::Fn(.., body),
                 ..
             }) => Some(body),
 
@@ -2176,7 +2175,7 @@ fn visit_fn_like_elision(&mut self, inputs: &'tcx [hir::Ty], output: Option<&'tc
                 if let hir::ItemKind::Trait(.., ref trait_items) = self.tcx
                     .hir()
                     .expect_item(self.tcx.hir().get_parent_item(parent))
-                    .node
+                    .kind
                 {
                     assoc_item_kind = trait_items
                         .iter()
@@ -2196,7 +2195,7 @@ fn visit_fn_like_elision(&mut self, inputs: &'tcx [hir::Ty], output: Option<&'tc
                 if let hir::ItemKind::Impl(.., ref self_ty, ref impl_items) = self.tcx
                     .hir()
                     .expect_item(self.tcx.hir().get_parent_item(parent))
-                    .node
+                    .kind
                 {
                     impl_self = Some(self_ty);
                     assoc_item_kind = impl_items
index c06a0feb6a99381f6f8d870e992b80c610832cec..0e4bab6eaf20cfda7ab118c13455a5c10e6e424b 100644 (file)
@@ -246,7 +246,7 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
     fn visit_item(&mut self, i: &'tcx Item) {
         let orig_in_trait_impl = self.in_trait_impl;
         let mut kind = AnnotationKind::Required;
-        match i.node {
+        match i.kind {
             // Inherent impls and foreign modules serve only as containers for other items,
             // they don't have their own stability. They still can be annotated as unstable
             // and propagate this unstability to children, but this annotation is completely
@@ -344,14 +344,14 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
     }
 
     fn visit_item(&mut self, i: &'tcx Item) {
-        match i.node {
+        match i.kind {
             // Inherent impls and foreign modules serve only as containers for other items,
             // they don't have their own stability. They still can be annotated as unstable
             // and propagate this unstability to children, but this annotation is completely
             // optional. They inherit stability from their parents when unannotated.
             hir::ItemKind::Impl(.., None, _, _) | hir::ItemKind::ForeignMod(..) => {}
 
-            _ => self.check_missing_stability(i.hir_id, i.span, i.node.descriptive_variant())
+            _ => self.check_missing_stability(i.hir_id, i.span, i.kind.descriptive_variant())
         }
 
         intravisit::walk_item(self, i)
@@ -797,7 +797,7 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
     }
 
     fn visit_item(&mut self, item: &'tcx hir::Item) {
-        match item.node {
+        match item.kind {
             hir::ItemKind::ExternCrate(_) => {
                 // compiler-generated `extern crate` items have a dummy span.
                 if item.span.is_dummy() { return }
index 13601c6fe164a0e085c487a1e5fe8d973c6cbd19..1ce5d72ba848e0e9f2f24373ff4efa55294550fd 100644 (file)
@@ -1001,7 +1001,7 @@ fn suggest_fn_call(
                     Ok(EvaluationResult::EvaluatedToAmbig) => {
                         if let Some(hir::Node::Item(hir::Item {
                             ident,
-                            node: hir::ItemKind::Fn(.., body_id),
+                            kind: hir::ItemKind::Fn(.., body_id),
                             ..
                         })) = self.tcx.hir().get_if_local(def_id) {
                             let body = self.tcx.hir().body(*body_id);
@@ -1106,7 +1106,7 @@ fn suggest_semicolon_removal(
         let parent_node = hir.get_parent_node(obligation.cause.body_id);
         let node = hir.find(parent_node);
         if let Some(hir::Node::Item(hir::Item {
-            node: hir::ItemKind::Fn(decl, _, _, body_id),
+            kind: hir::ItemKind::Fn(decl, _, _, body_id),
             ..
         })) = node {
             let body = hir.body(*body_id);
@@ -1163,7 +1163,7 @@ pub fn get_fn_like_arguments(&self, node: Node<'_>) -> (Span, Vec<ArgKind>) {
             }
             Node::Item(&hir::Item {
                 span,
-                node: hir::ItemKind::Fn(ref decl, ..),
+                kind: hir::ItemKind::Fn(ref decl, ..),
                 ..
             }) |
             Node::ImplItem(&hir::ImplItem {
index 6a99d12d1a425e258767ff4eb2907cd755bda081..6d0347563d0037bcebcfbaadbc27b3ed5dd68173 100644 (file)
@@ -654,7 +654,7 @@ pub fn impl_is_default(self, node_item_def_id: DefId) -> bool {
         match self.hir().as_local_hir_id(node_item_def_id) {
             Some(hir_id) => {
                 let item = self.hir().expect_item(hir_id);
-                if let hir::ItemKind::Impl(_, _, defaultness, ..) = item.node {
+                if let hir::ItemKind::Impl(_, _, defaultness, ..) = item.kind {
                     defaultness.is_default()
                 } else {
                     false
index 972eae45d18a87ca01322766a5b5020e12e18e8f..daf871463b2b630a7692e7e3973c527ab4919f67 100644 (file)
@@ -1554,7 +1554,7 @@ pub fn return_type_impl_trait(
         let hir_id = self.hir().as_local_hir_id(scope_def_id).unwrap();
         match self.hir().get(hir_id) {
             Node::Item(item) => {
-                match item.node {
+                match item.kind {
                     ItemKind::Fn(..) => { /* `type_of_def_id()` will work */ }
                     _ => {
                         return None;
index bd5ac5e5ab478457c99c664d6b5cb8ca12c8c92e..f107af0cd07ecbf8abd489978cc52d88fd7fbdfa 100644 (file)
@@ -3164,7 +3164,7 @@ fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> AssocItem {
     let parent_id = tcx.hir().get_parent_item(id);
     let parent_def_id = tcx.hir().local_def_id(parent_id);
     let parent_item = tcx.hir().expect_item(parent_id);
-    match parent_item.node {
+    match parent_item.kind {
         hir::ItemKind::Impl(.., ref impl_item_refs) => {
             if let Some(impl_item_ref) = impl_item_refs.iter().find(|i| i.id.hir_id == id) {
                 let assoc_item = tcx.associated_item_from_impl_item_ref(parent_def_id,
@@ -3189,7 +3189,7 @@ fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> AssocItem {
 
     span_bug!(parent_item.span,
               "unexpected parent of trait or impl item or item not found: {:?}",
-              parent_item.node)
+              parent_item.kind)
 }
 
 #[derive(Clone, HashStable)]
@@ -3221,7 +3221,7 @@ fn adt_sized_constraint(tcx: TyCtxt<'_>, def_id: DefId) -> AdtSizedConstraint<'_
 fn associated_item_def_ids(tcx: TyCtxt<'_>, def_id: DefId) -> &[DefId] {
     let id = tcx.hir().as_local_hir_id(def_id).unwrap();
     let item = tcx.hir().expect_item(id);
-    match item.node {
+    match item.kind {
         hir::ItemKind::Trait(.., ref trait_item_refs) => {
             tcx.arena.alloc_from_iter(
                 trait_item_refs.iter()
@@ -3262,7 +3262,7 @@ fn trait_of_item(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
 pub fn is_impl_trait_defn(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
     if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
         if let Node::Item(item) = tcx.hir().get(hir_id) {
-            if let hir::ItemKind::OpaqueTy(ref opaque_ty) = item.node {
+            if let hir::ItemKind::OpaqueTy(ref opaque_ty) = item.kind {
                 return opaque_ty.impl_trait_fn;
             }
         }
index 4fd971ca1153d9f6b71b1b2004a2a357f28a37b3..ccecacd62057ca17c2c5773cf96a46148af89f5b 100644 (file)
@@ -230,7 +230,7 @@ impl CodegenCx<'ll, 'tcx> {
             let llty = self.layout_of(ty).llvm_type(self);
             let (g, attrs) = match self.tcx.hir().get(id) {
                 Node::Item(&hir::Item {
-                    ref attrs, span, node: hir::ItemKind::Static(..), ..
+                    ref attrs, span, kind: hir::ItemKind::Static(..), ..
                 }) => {
                     let sym_str = sym.as_str();
                     if self.get_declared_value(&sym_str).is_some() {
index b6ae999a8e92f0666b7594f7f54c6b05ad2b435e..d634b73430a583f2e7a0b46e86fe09a89ea5155f 100644 (file)
@@ -94,11 +94,11 @@ fn reachable_non_generics_provider(
 
                 // Only consider nodes that actually have exported symbols.
                 Node::Item(&hir::Item {
-                    node: hir::ItemKind::Static(..),
+                    kind: hir::ItemKind::Static(..),
                     ..
                 }) |
                 Node::Item(&hir::Item {
-                    node: hir::ItemKind::Fn(..), ..
+                    kind: hir::ItemKind::Fn(..), ..
                 }) |
                 Node::ImplItem(&hir::ImplItem {
                     kind: hir::ImplItemKind::Method(..),
@@ -367,7 +367,7 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel
         // Emscripten cannot export statics, so reduce their export level here
         if tcx.sess.target.target.options.is_like_emscripten {
             if let Some(Node::Item(&hir::Item {
-                node: hir::ItemKind::Static(..),
+                kind: hir::ItemKind::Static(..),
                 ..
             })) = tcx.hir().get_if_local(sym_def_id) {
                 return SymbolExportLevel::Rust;
index 5801963c101ef1079dc773e837b7ca58c50fa656..10177d2997a76ffbd81a82e27cad229ced5d11d5 100644 (file)
@@ -30,7 +30,7 @@ fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx) {
             }
             MonoItem::GlobalAsm(hir_id) => {
                 let item = cx.tcx().hir().expect_item(hir_id);
-                if let hir::ItemKind::GlobalAsm(ref ga) = item.node {
+                if let hir::ItemKind::GlobalAsm(ref ga) = item.kind {
                     cx.codegen_global_asm(ga);
                 } else {
                     span_bug!(item.span, "Mismatch between hir::Item type and MonoItem type")
index a907a89162e53854df724e7a2da035792bf2a4f7..abe0ffb0e02c5366367c02d159ed2f15ac978976 100644 (file)
@@ -327,7 +327,7 @@ fn auto_labels(&mut self, item_id: hir::HirId, attr: &Attribute) -> (&'static st
         let node = self.tcx.hir().get(item_id);
         let (name, labels) = match node {
             HirNode::Item(item) => {
-                match item.node {
+                match item.kind {
                     // note: these are in the same order as hir::Item_;
                     // FIXME(michaelwoerister): do commented out ones
 
@@ -391,7 +391,7 @@ fn auto_labels(&mut self, item_id: hir::HirId, attr: &Attribute) -> (&'static st
                         &format!(
                             "clean/dirty auto-assertions not yet defined \
                              for Node::Item.node={:?}",
-                            item.node
+                            item.kind
                         )
                     ),
                 }
index 1cb909d24efcd91e491da4ccc78f0164e6de497c..d0a7eab071c311de1e85c66bc8ed89829c15cfac 100644 (file)
@@ -117,7 +117,7 @@ fn check_heap_type(&self, cx: &LateContext<'_, '_>, span: Span, ty: Ty<'_>) {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxPointers {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
-        match it.node {
+        match it.kind {
             hir::ItemKind::Fn(..) |
             hir::ItemKind::TyAlias(..) |
             hir::ItemKind::Enum(..) |
@@ -130,7 +130,7 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
         }
 
         // If it's a struct, we also have to check the fields' types
-        match it.node {
+        match it.kind {
             hir::ItemKind::Struct(ref struct_def, _) |
             hir::ItemKind::Union(ref struct_def, _) => {
                 for struct_field in struct_def.fields() {
@@ -233,7 +233,7 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
     }
 
     fn check_item(&mut self, cx: &EarlyContext<'_>, it: &ast::Item) {
-        match it.node {
+        match it.kind {
             ast::ItemKind::Trait(_, ast::Unsafety::Unsafe, ..) => {
                 self.report_unsafe(cx, it.span, "declaration of an `unsafe` trait")
             }
@@ -391,7 +391,7 @@ fn check_crate(&mut self, cx: &LateContext<'_, '_>, krate: &hir::Crate) {
     }
 
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
-        let desc = match it.node {
+        let desc = match it.kind {
             hir::ItemKind::Fn(..) => "a function",
             hir::ItemKind::Mod(..) => "a module",
             hir::ItemKind::Enum(..) => "an enum",
@@ -504,7 +504,7 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
         if !cx.access_levels.is_reachable(item.hir_id) {
             return;
         }
-        let (def, ty) = match item.node {
+        let (def, ty) = match item.kind {
             hir::ItemKind::Struct(_, ref ast_generics) => {
                 if !ast_generics.params.is_empty() {
                     return;
@@ -563,7 +563,7 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
             return;
         }
 
-        match item.node {
+        match item.kind {
             hir::ItemKind::Struct(..) |
             hir::ItemKind::Union(..) |
             hir::ItemKind::Enum(..) => {}
@@ -766,7 +766,7 @@ fn warn_if_doc(
 
 impl EarlyLintPass for UnusedDocComment {
     fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) {
-        if let ast::ItemKind::Mac(..) = item.node {
+        if let ast::ItemKind::Mac(..) = item.kind {
             self.warn_if_doc(cx, item.span, "macro expansions", true, &item.attrs);
         }
     }
@@ -809,7 +809,7 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
             return;
         }
 
-        match it.node {
+        match it.kind {
             hir::ItemKind::ExternCrate(..) => (),
             _ => return,
         };
@@ -849,7 +849,7 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidNoMangleItems {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
-        match it.node {
+        match it.kind {
             hir::ItemKind::Fn(.., ref generics, _) => {
                 if let Some(no_mangle_attr) = attr::find_by_name(&it.attrs, sym::no_mangle) {
                     for param in &generics.params {
@@ -992,7 +992,7 @@ fn check_attribute(&mut self, ctx: &LateContext<'_, '_>, attr: &ast::Attribute)
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnionsWithDropFields {
     fn check_item(&mut self, ctx: &LateContext<'_, '_>, item: &hir::Item) {
-        if let hir::ItemKind::Union(ref vdata, _) = item.node {
+        if let hir::ItemKind::Union(ref vdata, _) = item.kind {
             for field in vdata.fields() {
                 let field_ty = ctx.tcx.type_of(
                     ctx.tcx.hir().local_def_id(field.hir_id));
@@ -1137,7 +1137,7 @@ fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: hir::HirId, span: Span) {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeAliasBounds {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
-        let (ty, type_alias_generics) = match item.node {
+        let (ty, type_alias_generics) = match item.kind {
             hir::ItemKind::TyAlias(ref ty, ref generics) => (&*ty, generics),
             _ => return,
         };
@@ -1204,7 +1204,7 @@ fn check_const(cx: &LateContext<'_, '_>, body_id: hir::BodyId) {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedBrokenConst {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
-        match it.node {
+        match it.kind {
             hir::ItemKind::Const(_, body_id) => {
                 check_const(cx, body_id);
             },
@@ -1395,7 +1395,7 @@ pub fn new() -> Self {
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnameableTestItems {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
         if self.items_nameable {
-            if let hir::ItemKind::Mod(..) = it.node {}
+            if let hir::ItemKind::Mod(..) = it.kind {}
             else {
                 self.items_nameable = false;
                 self.boundary = it.hir_id;
@@ -1684,7 +1684,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
         let def_id = cx.tcx.hir().local_def_id(item.hir_id);
         if let hir::ItemKind::Struct(_, ref hir_generics)
             | hir::ItemKind::Enum(_, ref hir_generics)
-            | hir::ItemKind::Union(_, ref hir_generics) = item.node
+            | hir::ItemKind::Union(_, ref hir_generics) = item.kind
         {
             let inferred_outlives = cx.tcx.inferred_outlives_of(def_id);
             if inferred_outlives.is_empty() {
@@ -1812,7 +1812,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
                 // generics, except for tuple struct, which have the `where`
                 // after the fields of the struct.
                 let full_where_span = if let hir::ItemKind::Struct(hir::VariantData::Tuple(..), _)
-                        = item.node
+                        = item.kind
                 {
                     where_span
                 } else {
index e1dfe390f19fc7ed935ef3fedb9c77ffca3962cb..dceb79fd30985d7aa341d372df2b47993e65a96b 100644 (file)
@@ -136,7 +136,7 @@ fn check_item(&mut self, cx: &EarlyContext<'_>, it: &ast::Item) {
             return;
         }
 
-        match it.node {
+        match it.kind {
             ast::ItemKind::TyAlias(..) |
             ast::ItemKind::Enum(..) |
             ast::ItemKind::Struct(..) |
@@ -326,7 +326,7 @@ fn check_fn(
     }
 
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
-        if let hir::ItemKind::Mod(_) = it.node {
+        if let hir::ItemKind::Mod(_) = it.kind {
             self.check_snake_case(cx, "module", &it.ident);
         }
     }
@@ -387,7 +387,7 @@ fn check_upper_case(cx: &LateContext<'_, '_>, sort: &str, ident: &Ident) {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
-        match it.node {
+        match it.kind {
             hir::ItemKind::Static(..) if !attr::contains_name(&it.attrs, sym::no_mangle) => {
                 NonUpperCaseGlobals::check_upper_case(cx, "static variable", &it.ident);
             }
index eacfe4be9e59b19ea516e1a69d21334911658e15..1fb377c9ad657f1781225c004cdabd7e90d3f2a6 100644 (file)
@@ -995,7 +995,7 @@ fn check_foreign_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::ForeignItem
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for VariantSizeDifferences {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
-        if let hir::ItemKind::Enum(ref enum_definition, _) = it.node {
+        if let hir::ItemKind::Enum(ref enum_definition, _) = it.kind {
             let item_def_id = cx.tcx.hir().local_def_id(it.hir_id);
             let t = cx.tcx.type_of(item_def_id);
             let ty = cx.tcx.erase_regions(&t);
index d0149b0e90909ffbbb70f05ed9a62042106cd9b2..3b3995832cb4cb1f9663c6bad8ae604fbc8e3a7e 100644 (file)
@@ -647,7 +647,7 @@ fn check_use_tree(&self, cx: &EarlyContext<'_>, use_tree: &ast::UseTree, item: &
 
 impl EarlyLintPass for UnusedImportBraces {
     fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) {
-        if let ast::ItemKind::Use(ref use_tree) = item.node {
+        if let ast::ItemKind::Use(ref use_tree) = item.kind {
             self.check_use_tree(cx, use_tree, item);
         }
     }
index af41b6a4c857f092101cac0c8286eaeda6e7e136..0a2a481bb1500d5e5541b687d94ef45d2c414f64 100644 (file)
@@ -999,7 +999,7 @@ pub fn postprocess(&mut self, krate: &ast::Crate) {
     pub fn process_extern_crate(
         &mut self, item: &ast::Item, definitions: &Definitions,
     ) -> CrateNum {
-        match item.node {
+        match item.kind {
             ast::ItemKind::ExternCrate(orig_name) => {
                 debug!("resolving extern crate stmt. ident: {} orig_name: {:?}",
                        item.ident, orig_name);
index 11121ee875ddab9cf0f3c065fe58b5c11640f339..8a7e599ebeb63bf21ec425e4bbf37e2c7f5281ad 100644 (file)
@@ -479,7 +479,7 @@ pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro {
             id: ast::DUMMY_NODE_ID,
             span: local_span,
             attrs: attrs.iter().cloned().collect(),
-            node: ast::ItemKind::MacroDef(ast::MacroDef {
+            kind: ast::ItemKind::MacroDef(ast::MacroDef {
                 tokens: body.into(),
                 legacy: def.legacy,
             }),
index 1c72a8c6ddbd600c81758cb1443518a0369d14de..b89da65d09808a70fe0c5ff8c9a57f07d858e39e 100644 (file)
@@ -1117,7 +1117,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
 
         debug!("EncodeContext::encode_info_for_item({:?})", def_id);
 
-        let kind = match item.node {
+        let kind = match item.kind {
             hir::ItemKind::Static(_, hir::MutMutable, _) => EntryKind::MutStatic,
             hir::ItemKind::Static(_, hir::MutImmutable, _) => EntryKind::ImmStatic,
             hir::ItemKind::Const(_, body_id) => {
@@ -1233,7 +1233,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
             hir::ItemKind::Use(..) => bug!("cannot encode info for item {:?}", item),
         };
 
-        let mir = match item.node {
+        let mir = match item.kind {
             hir::ItemKind::Static(..) | hir::ItemKind::Const(..) => true,
             hir::ItemKind::Fn(_, header, ..) => {
                 let generics = tcx.generics_of(def_id);
@@ -1252,7 +1252,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
             visibility: self.lazy(ty::Visibility::from_hir(&item.vis, item.hir_id, tcx)),
             span: self.lazy(item.span),
             attributes: self.encode_attributes(&item.attrs),
-            children: match item.node {
+            children: match item.kind {
                 hir::ItemKind::ForeignMod(ref fm) => {
                     self.lazy(fm.items
                         .iter()
@@ -1286,7 +1286,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
             stability: self.encode_stability(def_id),
             deprecation: self.encode_deprecation(def_id),
 
-            ty: match item.node {
+            ty: match item.kind {
                 hir::ItemKind::Static(..) |
                 hir::ItemKind::Const(..) |
                 hir::ItemKind::Fn(..) |
@@ -1299,14 +1299,14 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
                 _ => None,
             },
             inherent_impls: self.encode_inherent_implementations(def_id),
-            variances: match item.node {
+            variances: match item.kind {
                 hir::ItemKind::Enum(..) |
                 hir::ItemKind::Struct(..) |
                 hir::ItemKind::Union(..) |
                 hir::ItemKind::Fn(..) => self.encode_variances_of(def_id),
                 _ => Lazy::empty(),
             },
-            generics: match item.node {
+            generics: match item.kind {
                 hir::ItemKind::Static(..) |
                 hir::ItemKind::Const(..) |
                 hir::ItemKind::Fn(..) |
@@ -1320,7 +1320,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
                 hir::ItemKind::TraitAlias(..) => Some(self.encode_generics(def_id)),
                 _ => None,
             },
-            predicates: match item.node {
+            predicates: match item.kind {
                 hir::ItemKind::Static(..) |
                 hir::ItemKind::Const(..) |
                 hir::ItemKind::Fn(..) |
@@ -1340,7 +1340,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
             // so only encode it in that case as an efficiency
             // hack. (No reason not to expand it in the future if
             // necessary.)
-            predicates_defined_on: match item.node {
+            predicates_defined_on: match item.kind {
                 hir::ItemKind::Trait(..) |
                 hir::ItemKind::TraitAlias(..) => Some(self.encode_predicates_defined_on(def_id)),
                 _ => None, // not *wrong* for other kinds of items, but not needed
@@ -1728,7 +1728,7 @@ fn visit_expr(&mut self, ex: &'tcx hir::Expr) {
     fn visit_item(&mut self, item: &'tcx hir::Item) {
         intravisit::walk_item(self, item);
         let def_id = self.tcx.hir().local_def_id(item.hir_id);
-        match item.node {
+        match item.kind {
             hir::ItemKind::ExternCrate(_) |
             hir::ItemKind::Use(..) => {} // ignore these
             _ => self.record(def_id, EncodeContext::encode_info_for_item, (def_id, item)),
@@ -1824,7 +1824,7 @@ fn encode_info_for_expr(&mut self, expr: &hir::Expr) {
     /// normally in the visitor walk.
     fn encode_addl_info_for_item(&mut self, item: &hir::Item) {
         let def_id = self.tcx.hir().local_def_id(item.hir_id);
-        match item.node {
+        match item.kind {
             hir::ItemKind::Static(..) |
             hir::ItemKind::Const(..) |
             hir::ItemKind::Fn(..) |
@@ -1893,7 +1893,7 @@ struct ImplVisitor<'tcx> {
 
 impl<'tcx, 'v> ItemLikeVisitor<'v> for ImplVisitor<'tcx> {
     fn visit_item(&mut self, item: &hir::Item) {
-        if let hir::ItemKind::Impl(..) = item.node {
+        if let hir::ItemKind::Impl(..) = item.kind {
             let impl_id = self.tcx.hir().local_def_id(item.hir_id);
             if let Some(trait_ref) = self.tcx.impl_trait_ref(impl_id) {
                 self.impls
index b2e40282d93323a04654b04ec5ed1bb249ca382b..8a4f6e6f17a5112733fc69a4ffe2e3dcd082e4fd 100644 (file)
@@ -19,7 +19,7 @@ struct Collector<'tcx> {
 
 impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
     fn visit_item(&mut self, it: &'tcx hir::Item) {
-        let fm = match it.node {
+        let fm = match it.kind {
             hir::ItemKind::ForeignMod(ref fm) => fm,
             _ => return,
         };
index 728fd004fcb693a2ce8b71b88b6746a9bcb65212..527d4421fca656d9a9a4250eba539713f707fe66 100644 (file)
@@ -27,7 +27,7 @@ struct Collector {
 
 impl<'tcx> ItemLikeVisitor<'tcx> for Collector {
     fn visit_item(&mut self, it: &'tcx hir::Item) {
-        let fm = match it.node {
+        let fm = match it.kind {
             hir::ItemKind::ForeignMod(ref fm) => fm,
             _ => return,
         };
index ada1a8c615d44743ac3d9ce3f5171c7322f8ae22..fe215d9c7999ea66c453d20689fa2da730f2fafc 100644 (file)
@@ -35,7 +35,7 @@ struct Collector<'tcx> {
 
 impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
     fn visit_item(&mut self, it: &'tcx hir::Item) {
-        let fm = match it.node {
+        let fm = match it.kind {
             hir::ItemKind::ForeignMod(ref fm) => fm,
             _ => return,
         };
index 0645e3b96c97101c5e055cc98038b795cc8f3ab4..6b7fee6effbe1000c2c59b42f5e3c75db7125c7c 100644 (file)
@@ -28,7 +28,7 @@ pub fn mir_build(tcx: TyCtxt<'_>, def_id: DefId) -> Body<'_> {
     // Figure out what primary body this item has.
     let (body_id, return_ty_span) = match tcx.hir().get(id) {
         Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(_, decl, body_id, _, _), .. })
-        | Node::Item(hir::Item { node: hir::ItemKind::Fn(decl, _, _, body_id), .. })
+        | Node::Item(hir::Item { kind: hir::ItemKind::Fn(decl, _, _, body_id), .. })
         | Node::ImplItem(
             hir::ImplItem {
                 kind: hir::ImplItemKind::Method(hir::MethodSig { decl, .. }, body_id),
@@ -46,8 +46,8 @@ pub fn mir_build(tcx: TyCtxt<'_>, def_id: DefId) -> Body<'_> {
         ) => {
             (*body_id, decl.output.span())
         }
-        Node::Item(hir::Item { node: hir::ItemKind::Static(ty, _, body_id), .. })
-        | Node::Item(hir::Item { node: hir::ItemKind::Const(ty, body_id), .. })
+        Node::Item(hir::Item { kind: hir::ItemKind::Static(ty, _, body_id), .. })
+        | Node::Item(hir::Item { kind: hir::ItemKind::Const(ty, body_id), .. })
         | Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Const(ty, body_id), .. })
         | Node::TraitItem(
             hir::TraitItem { kind: hir::TraitItemKind::Const(ty, Some(body_id)), .. }
index 2c000f931ef1f0f92b5c155efc6072a0c281dfcd..cc8f4759e183791d20e2f3e52370c380495ba93d 100644 (file)
@@ -981,7 +981,7 @@ struct RootCollector<'a, 'tcx> {
 
 impl ItemLikeVisitor<'v> for RootCollector<'_, 'v> {
     fn visit_item(&mut self, item: &'v hir::Item) {
-        match item.node {
+        match item.kind {
             hir::ItemKind::ExternCrate(..) |
             hir::ItemKind::Use(..)         |
             hir::ItemKind::ForeignMod(..)  |
@@ -1141,7 +1141,7 @@ fn create_mono_items_for_default_impls<'tcx>(
     item: &'tcx hir::Item,
     output: &mut Vec<MonoItem<'tcx>>,
 ) {
-    match item.node {
+    match item.kind {
         hir::ItemKind::Impl(_, _, _, ref generics, .., ref impl_item_refs) => {
             for param in &generics.params {
                 match param.kind {
index faec8c7cbe400f846f7f6d1d418112b78ef0ab68..acd53ac68ae3f27d4290f8f20f9ee72217808fce 100644 (file)
@@ -577,7 +577,7 @@ fn is_enclosed(
         if used_unsafe.contains(&parent_id) {
             Some(("block".to_string(), parent_id))
         } else if let Some(Node::Item(&hir::Item {
-            node: hir::ItemKind::Fn(_, header, _, _),
+            kind: hir::ItemKind::Fn(_, header, _, _),
             ..
         })) = tcx.hir().find(parent_id) {
             match header.unsafety {
index 5ccf73290a6329eab665ab375bc48f35092dfd0b..89497641c1007ce47c13ea4cd7df372c51eac385 100644 (file)
@@ -538,7 +538,7 @@ fn visit_item(&mut self, item: &'a Item) {
             self.has_proc_macro_decls = true;
         }
 
-        match item.node {
+        match item.kind {
             ItemKind::Impl(unsafety, polarity, _, _, Some(..), ref ty, ref impl_items) => {
                 self.invalid_visibility(&item.vis, None);
                 if let TyKind::Err = ty.kind {
index 45a185dccf29c7d829088494048a7130826d65f1..06683c16e4a9bee0b0e73455bc58440f55ab0f51 100644 (file)
@@ -31,7 +31,7 @@ impl ItemLikeVisitor<'tcx> for VarianceTest<'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item) {
         let item_def_id = self.tcx.hir().local_def_id(item.hir_id);
 
-        if let ItemKind::TyAlias(..) = item.node {
+        if let ItemKind::TyAlias(..) = item.kind {
             for attr in self.tcx.get_attrs(item_def_id).iter() {
                 if attr.check_name(sym::rustc_layout) {
                     self.dump_layout_of(item_def_id, item, attr);
index f1bf1111cf700d0ea3b43725721b4e0f3abe9a92..01559a95c9c31d83a7bdf826da85a9be157aed01 100644 (file)
@@ -15,7 +15,7 @@ struct RegistrarFinder {
 
 impl<'v> ItemLikeVisitor<'v> for RegistrarFinder {
     fn visit_item(&mut self, item: &hir::Item) {
-        if let hir::ItemKind::Fn(..) = item.node {
+        if let hir::ItemKind::Fn(..) = item.kind {
             if attr::contains_name(&item.attrs, sym::plugin_registrar) {
                 self.registrars.push((item.hir_id, item.span));
             }
index a72c9e574d0df21440c4b93203a98f9f768f632a..f44692b7aea7d6193dff4f35d160d017c00d5e7a 100644 (file)
@@ -240,7 +240,7 @@ fn def_id_visibility<'tcx>(
                 }
                 Node::ImplItem(impl_item) => {
                     match tcx.hir().get(tcx.hir().get_parent_item(hir_id)) {
-                        Node::Item(item) => match &item.node {
+                        Node::Item(item) => match &item.kind {
                             hir::ItemKind::Impl(.., None, _, _) => &impl_item.vis,
                             hir::ItemKind::Impl(.., Some(trait_ref), _, _)
                                 => return def_id_visibility(tcx, trait_ref.path.res.def_id()),
@@ -572,7 +572,7 @@ fn update_macro_reachable_def(
                 if let ty::Visibility::Public = vis {
                     let item = self.tcx.hir().expect_item(hir_id);
                     if let hir::ItemKind::Struct(ref struct_def, _)
-                        | hir::ItemKind::Union(ref struct_def, _) = item.node
+                        | hir::ItemKind::Union(ref struct_def, _) = item.kind
                     {
                         for field in struct_def.fields() {
                             let field_vis = ty::Visibility::from_hir(
@@ -630,12 +630,12 @@ fn update_visibility_of_intermediate_use_statements(&mut self, segments: &[hir::
                 .and_then(|def_id| self.tcx.hir().as_local_hir_id(def_id))
                 .map(|module_hir_id| self.tcx.hir().expect_item(module_hir_id))
              {
-                if let hir::ItemKind::Mod(m) = &item.node {
+                if let hir::ItemKind::Mod(m) = &item.kind {
                     for item_id in m.item_ids.as_ref() {
                         let item = self.tcx.hir().expect_item(item_id.id);
                         let def_id = self.tcx.hir().local_def_id(item_id.id);
                         if !self.tcx.hygienic_eq(segment.ident, item.ident, def_id) { continue; }
-                        if let hir::ItemKind::Use(..) = item.node {
+                        if let hir::ItemKind::Use(..) = item.kind {
                             self.update(item.hir_id, Some(AccessLevel::Exported));
                         }
                     }
@@ -653,7 +653,7 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
     }
 
     fn visit_item(&mut self, item: &'tcx hir::Item) {
-        let inherited_item_level = match item.node {
+        let inherited_item_level = match item.kind {
             hir::ItemKind::Impl(..) =>
                 Option::<AccessLevel>::of_impl(item.hir_id, self.tcx, &self.access_levels),
             // Foreign modules inherit level from parents.
@@ -673,7 +673,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
         let item_level = self.update(item.hir_id, inherited_item_level);
 
         // Update levels of nested things.
-        match item.node {
+        match item.kind {
             hir::ItemKind::Enum(ref def, _) => {
                 for variant in &def.variants {
                     let variant_level = self.update(variant.id, item_level);
@@ -727,7 +727,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
         }
 
         // Mark all items in interfaces of reachable items as reachable.
-        match item.node {
+        match item.kind {
             // The interface is empty.
             hir::ItemKind::ExternCrate(..) => {}
             // All nested items are checked by `visit_item`.
@@ -1417,7 +1417,7 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
     }
 
     fn visit_item(&mut self, item: &'tcx hir::Item) {
-        match item.node {
+        match item.kind {
             // Contents of a private mod can be re-exported, so we need
             // to check internals.
             hir::ItemKind::Mod(_) => {}
@@ -1853,7 +1853,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
         let tcx = self.tcx;
         let item_visibility = ty::Visibility::from_hir(&item.vis, item.hir_id, tcx);
 
-        match item.node {
+        match item.kind {
             // Crates are always public.
             hir::ItemKind::ExternCrate(..) => {}
             // All nested items are checked by `visit_item`.
index bd0606cb67063e3d17d5df06958c4f8aaf71c205..f1564c300180e5e0ce89170b9b64b08a5836d809 100644 (file)
@@ -588,7 +588,7 @@ fn build_reduced_graph_for_item(&mut self, item: &'b Item) {
         let sp = item.span;
         let vis = self.resolve_visibility(&item.vis);
 
-        match item.node {
+        match item.kind {
             ItemKind::Use(ref use_tree) => {
                 self.build_reduced_graph_for_use_tree(
                     // This particular use tree
@@ -936,7 +936,7 @@ fn process_legacy_macro_imports(&mut self, item: &Item, module: Module<'a>) -> b
                     span_err!(self.r.session, item.span, E0468,
                         "an `extern crate` loading macros must be at the crate root");
                 }
-                if let ItemKind::ExternCrate(Some(orig_name)) = item.node {
+                if let ItemKind::ExternCrate(Some(orig_name)) = item.kind {
                     if orig_name == kw::SelfLower {
                         self.r.session.span_err(attr.span,
                             "`macro_use` is not supported on `extern crate self`");
@@ -1064,7 +1064,7 @@ fn proc_macro_stub(item: &ast::Item) -> Option<(MacroKind, Ident, Span)> {
     fn define_macro(&mut self, item: &ast::Item) -> LegacyScope<'a> {
         let parent_scope = &self.parent_scope;
         let expansion = parent_scope.expansion;
-        let (ext, ident, span, is_legacy) = match &item.node {
+        let (ext, ident, span, is_legacy) = match &item.kind {
             ItemKind::MacroDef(def) => {
                 let ext = Lrc::new(self.r.compile_macro(item, self.r.session.edition()));
                 (ext, item.ident, item.span, def.legacy)
@@ -1138,7 +1138,7 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
     method!(visit_ty:        ast::Ty,       ast::TyKind::Mac,         walk_ty);
 
     fn visit_item(&mut self, item: &'b Item) {
-        let macro_use = match item.node {
+        let macro_use = match item.kind {
             ItemKind::MacroDef(..) => {
                 self.parent_scope.legacy = self.define_macro(item);
                 return
index 0d85be83e12e04d437889a85fdf594ddd81fae87..737589acf8d8146fece502646e89af09d8b2230e 100644 (file)
@@ -103,7 +103,7 @@ fn visit_item(&mut self, item: &'a ast::Item) {
         // whether they're used or not. Also ignore imports with a dummy span
         // because this means that they were generated in some fashion by the
         // compiler and we don't need to consider them.
-        if let ast::ItemKind::Use(..) = item.node {
+        if let ast::ItemKind::Use(..) = item.kind {
             if item.vis.node.is_pub() || item.span.is_dummy() {
                 return;
             }
index 3f66829e8f8483b2d5d9ff7062cb5182cc2851fc..e02cba6fbfd25793bd10f509083daebbe0a08869 100644 (file)
@@ -700,9 +700,9 @@ fn future_proof_import(&mut self, use_tree: &UseTree) {
 
     fn resolve_item(&mut self, item: &Item) {
         let name = item.ident.name;
-        debug!("(resolving item) resolving {} ({:?})", name, item.node);
+        debug!("(resolving item) resolving {} ({:?})", name, item.kind);
 
-        match item.node {
+        match item.kind {
             ItemKind::TyAlias(_, ref generics) |
             ItemKind::OpaqueTy(_, ref generics) |
             ItemKind::Fn(_, _, ref generics, _) => {
@@ -1805,7 +1805,7 @@ fn resolve_block(&mut self, block: &Block) {
         // Descend into the block.
         for stmt in &block.stmts {
             if let StmtKind::Item(ref item) = stmt.kind {
-                if let ItemKind::MacroDef(..) = item.node {
+                if let ItemKind::MacroDef(..) = item.kind {
                     num_macro_definition_ribs += 1;
                     let res = self.r.definitions.local_def_id(item.id);
                     self.ribs[ValueNS].push(Rib::new(MacroDefinition(res)));
index 74f68e514712623af4f8eda8d66831f1b706c873..bf86a374338402e29dce5cc72ab08bcf60d488d2 100644 (file)
@@ -290,7 +290,7 @@ fn visit_mod(
         }
         // find a use statement
         for item in &module.items {
-            match item.node {
+            match item.kind {
                 ItemKind::Use(..) => {
                     // don't suggest placing a use before the prelude
                     // import or other generated ones
index c24552678eb534dcf19718197f7fe8ab7d1accbc..d81d24e3a1b99895c1cd5c69de3e330b2a13b97b 100644 (file)
@@ -472,13 +472,13 @@ fn process_struct(
         let qualname = format!("::{}",
             self.tcx.def_path_str(self.tcx.hir().local_def_id_from_node_id(item.id)));
 
-        let kind = match item.node {
+        let kind = match item.kind {
             ast::ItemKind::Struct(_, _) => DefKind::Struct,
             ast::ItemKind::Union(_, _) => DefKind::Union,
             _ => unreachable!(),
         };
 
-        let (value, fields) = match item.node {
+        let (value, fields) = match item.kind {
             ast::ItemKind::Struct(ast::VariantData::Struct(ref fields, ..), ..) |
             ast::ItemKind::Union(ast::VariantData::Struct(ref fields, ..), ..) => {
                 let include_priv_fields = !self.save_ctxt.config.pub_only;
@@ -1276,7 +1276,7 @@ fn visit_mod(&mut self, m: &'l ast::Mod, span: Span, attrs: &[ast::Attribute], i
     fn visit_item(&mut self, item: &'l ast::Item) {
         use syntax::ast::ItemKind::*;
         self.process_macro_use(item.span);
-        match item.node {
+        match item.kind {
             Use(ref use_tree) => {
                 let prefix = ast::Path {
                     segments: vec![],
index bc067ab6ba52acf2e7d78f9810f4088d8b2ba15f..20cf7949fecde88fb0c295a461a1d13729d25e00 100644 (file)
@@ -177,7 +177,7 @@ pub fn get_extern_item_data(&self, item: &ast::ForeignItem) -> Option<Data> {
     }
 
     pub fn get_item_data(&self, item: &ast::Item) -> Option<Data> {
-        match item.node {
+        match item.kind {
             ast::ItemKind::Fn(ref decl, .., ref generics, _) => {
                 let qualname = format!("::{}",
                     self.tcx.def_path_str(self.tcx.hir().local_def_id_from_node_id(item.id)));
@@ -396,7 +396,7 @@ pub fn get_method_data(&self, id: ast::NodeId, ident: ast::Ident, span: Span) ->
         let (qualname, parent_scope, decl_id, docs, attributes) =
             match self.tcx.impl_of_method(self.tcx.hir().local_def_id_from_node_id(id)) {
                 Some(impl_id) => match self.tcx.hir().get_if_local(impl_id) {
-                    Some(Node::Item(item)) => match item.node {
+                    Some(Node::Item(item)) => match item.kind {
                         hir::ItemKind::Impl(.., ref ty, _) => {
                             let mut qualname = String::from("<");
                             qualname.push_str(&self.tcx.hir().hir_to_pretty_string(ty.hir_id));
@@ -612,7 +612,7 @@ pub fn get_path_res(&self, id: NodeId) -> Res {
             Node::TraitRef(tr) => tr.path.res,
 
             Node::Item(&hir::Item {
-                node: hir::ItemKind::Use(ref path, _),
+                kind: hir::ItemKind::Use(ref path, _),
                 ..
             }) |
             Node::Visibility(&Spanned {
index 87417f577a1ae6ca911717fc442fd2fb4f7c26d0..8a0c9069224fe515168ca49e80722550b8344526 100644 (file)
@@ -324,7 +324,7 @@ impl Sig for ast::Item {
     fn make(&self, offset: usize, _parent_id: Option<NodeId>, scx: &SaveContext<'_, '_>) -> Result {
         let id = Some(self.id);
 
-        match self.node {
+        match self.kind {
             ast::ItemKind::Static(ref ty, m, ref expr) => {
                 let mut text = "static ".to_owned();
                 if m == ast::Mutability::Mutable {
index 6eec7158e47172a3bc2312875d0c2e6752274862..f923f51529aa9d4c313f02499a8906750032f848 100644 (file)
@@ -205,7 +205,7 @@ enum NodeKind {
             _ => NodeKind::Other,
         }
 
-        Node::Item(item) => match item.node {
+        Node::Item(item) => match item.kind {
             ItemKind::Impl(.., Some(..), _, _) => NodeKind::TraitImpl,
             ItemKind::Impl(.., None, _, _) => NodeKind::InherentImpl,
             ItemKind::Fn(..) => NodeKind::Fn,
index 019a82350bde39c1c24835f97944192cb9d860b4..13b6b1b8aa08dc332652e09e851a404e2dcfbd40 100644 (file)
@@ -248,7 +248,7 @@ fn maybe_get_coercion_reason(&self, hir_id: hir::HirId, span: Span) -> Option<(S
                 ),
             );
             if let (Some(expr), Item(hir::Item {
-                node: hir::ItemKind::Fn(..), ..
+                kind: hir::ItemKind::Fn(..), ..
             })) = (&block.expr, parent) {
                 // check that the `if` expr without `else` is the fn body's expr
                 if expr.span == span {
index 4b02bc58d66c61d6893d2acd7cd055bbcae8c6ff..2d4d2e32f23dbada7d2c41f82dd02a6411655d81 100644 (file)
@@ -895,7 +895,7 @@ struct Visitor<'a, 'tcx> {
 
     impl<'v, 'a, 'tcx> itemlikevisit::ItemLikeVisitor<'v> for Visitor<'a, 'tcx> {
         fn visit_item(&mut self, i: &'v hir::Item) {
-            match i.node {
+            match i.kind {
                 hir::ItemKind::Trait(..) |
                 hir::ItemKind::TraitAlias(..) => {
                     let def_id = self.map.local_def_id(i.hir_id);
@@ -999,7 +999,7 @@ fn visit_mod(
         // Find a `use` statement.
         for item_id in &module.item_ids {
             let item = self.tcx.hir().expect_item(item_id.id);
-            match item.node {
+            match item.kind {
                 hir::ItemKind::Use(..) => {
                     // Don't suggest placing a `use` before the prelude
                     // import or other generated ones.
index 91297d6ecd02ccf2dc7ac1269b5635cbe9a19b8e..15c98432cc221f4f6a69c241872ea9f25d9ce14a 100644 (file)
@@ -792,7 +792,7 @@ fn primary_body_of(
 ) -> Option<(hir::BodyId, Option<&hir::Ty>, Option<&hir::FnHeader>, Option<&hir::FnDecl>)> {
     match tcx.hir().get(id) {
         Node::Item(item) => {
-            match item.node {
+            match item.kind {
                 hir::ItemKind::Const(ref ty, body) |
                 hir::ItemKind::Static(ref ty, _, body) =>
                     Some((body, Some(ty), None, None)),
@@ -1262,7 +1262,7 @@ fn check_fn<'a, 'tcx>(
                     }
 
                     if let Node::Item(item) = fcx.tcx.hir().get(fn_id) {
-                        if let ItemKind::Fn(_, _, ref generics, _) = item.node {
+                        if let ItemKind::Fn(_, _, ref generics, _) = item.kind {
                             if !generics.params.is_empty() {
                                 fcx.tcx.sess.span_err(
                                     span,
@@ -1310,7 +1310,7 @@ fn check_fn<'a, 'tcx>(
                     }
 
                     if let Node::Item(item) = fcx.tcx.hir().get(fn_id) {
-                        if let ItemKind::Fn(_, _, ref generics, _) = item.node {
+                        if let ItemKind::Fn(_, _, ref generics, _) = item.kind {
                             if !generics.params.is_empty() {
                                 fcx.tcx.sess.span_err(
                                     span,
@@ -1403,7 +1403,7 @@ fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
         }
     }
 
-    let prohibit_opaque = match item.node {
+    let prohibit_opaque = match item.kind {
         ItemKind::OpaqueTy(hir::OpaqueTy { origin: hir::OpaqueTyOrigin::AsyncFn, .. }) |
         ItemKind::OpaqueTy(hir::OpaqueTy { origin: hir::OpaqueTyOrigin::FnReturn, .. }) => {
             let mut visitor = ProhibitOpaqueVisitor {
@@ -1421,7 +1421,7 @@ fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
 
     debug!("check_opaque_for_inheriting_lifetimes: prohibit_opaque={:?}", prohibit_opaque);
     if prohibit_opaque {
-        let is_async = match item.node {
+        let is_async = match item.kind {
             ItemKind::OpaqueTy(hir::OpaqueTy { origin, .. }) => match origin {
                 hir::OpaqueTyOrigin::AsyncFn => true,
                 _ => false,
@@ -1485,7 +1485,7 @@ pub fn check_item_type<'tcx>(tcx: TyCtxt<'tcx>, it: &'tcx hir::Item) {
         tcx.def_path_str(tcx.hir().local_def_id(it.hir_id))
     );
     let _indenter = indenter();
-    match it.node {
+    match it.kind {
         // Consts can play a role in type-checking, so they are included here.
         hir::ItemKind::Static(..) => {
             let def_id = tcx.hir().local_def_id(it.hir_id);
@@ -4069,7 +4069,7 @@ fn parent_item_span(&self, id: hir::HirId) -> Option<Span> {
         let node = self.tcx.hir().get(self.tcx.hir().get_parent_item(id));
         match node {
             Node::Item(&hir::Item {
-                node: hir::ItemKind::Fn(_, _, _, body_id), ..
+                kind: hir::ItemKind::Fn(_, _, _, body_id), ..
             }) |
             Node::ImplItem(&hir::ImplItem {
                 kind: hir::ImplItemKind::Method(_, body_id), ..
@@ -4094,7 +4094,7 @@ fn get_parent_fn_decl(&self, blk_id: hir::HirId) -> Option<(&'tcx hir::FnDecl, a
     fn get_node_fn_decl(&self, node: Node<'tcx>) -> Option<(&'tcx hir::FnDecl, ast::Ident, bool)> {
         match node {
             Node::Item(&hir::Item {
-                ident, node: hir::ItemKind::Fn(ref decl, ..), ..
+                ident, kind: hir::ItemKind::Fn(ref decl, ..), ..
             }) => {
                 // This is less than ideal, it will not suggest a return type span on any
                 // method called `main`, regardless of whether it is actually the entry point,
@@ -4192,7 +4192,7 @@ fn suggest_fn_call(
             let mut msg = "call this function";
             match hir.get_if_local(def_id) {
                 Some(Node::Item(hir::Item {
-                    node: ItemKind::Fn(.., body_id),
+                    kind: ItemKind::Fn(.., body_id),
                     ..
                 })) |
                 Some(Node::ImplItem(hir::ImplItem {
index 732499cae141b56afafe535922fcd2ac0b01e437..d55777789502c7917353284b06490cb3eaade867 100644 (file)
@@ -76,7 +76,7 @@ pub fn check_item_well_formed(tcx: TyCtxt<'_>, def_id: DefId) {
            item.hir_id,
            tcx.def_path_str(def_id));
 
-    match item.node {
+    match item.kind {
         // Right now we check that every default trait implementation
         // has an implementation of itself. Basically, a case like:
         //
@@ -299,7 +299,7 @@ fn check_type_defn<'tcx, F>(
                         field.span,
                         fcx.body_id,
                         traits::FieldSized {
-                            adt_kind: match item.node.adt_kind() {
+                            adt_kind: match item.kind.adt_kind() {
                                 Some(i) => i,
                                 None => bug!(),
                             },
index ffc66ec16de139ed68602ea89f1d63bc7fd6fd9e..7af1a342ff36edd98b532739407c13aa4910aae7 100644 (file)
@@ -33,7 +33,7 @@ fn visit_item(&mut self, item: &hir::Item) {
         if item.vis.node.is_pub() || item.span.is_dummy() {
             return;
         }
-        if let hir::ItemKind::Use(ref path, _) = item.node {
+        if let hir::ItemKind::Use(ref path, _) = item.kind {
             self.check_import(item.hir_id, path.span);
         }
     }
@@ -218,7 +218,7 @@ struct ExternCrateToLint {
 
 impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for CollectExternCrateVisitor<'a, 'tcx> {
     fn visit_item(&mut self, item: &hir::Item) {
-        if let hir::ItemKind::ExternCrate(orig_name) = item.node {
+        if let hir::ItemKind::ExternCrate(orig_name) = item.kind {
             let extern_crate_def_id = self.tcx.hir().local_def_id(item.hir_id);
             self.crates_to_lint.push(
                 ExternCrateToLint {
index 9054c2b80102af4dba05ce27d7c97f3b409b8806..64bd144dfa226103b652ebe9ccb2c7021b7bc29b 100644 (file)
@@ -53,7 +53,7 @@ fn visit_implementation_of_drop(tcx: TyCtxt<'_>, impl_did: DefId) {
         // Destructors only work on nominal types.
         if let Some(impl_hir_id) = tcx.hir().as_local_hir_id(impl_did) {
             if let Some(Node::Item(item)) = tcx.hir().find(impl_hir_id) {
-                let span = match item.node {
+                let span = match item.kind {
                     ItemKind::Impl(.., ref ty, _) => ty.span,
                     _ => item.span,
                 };
@@ -99,7 +99,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: DefId) {
         Ok(()) => {}
         Err(CopyImplementationError::InfrigingFields(fields)) => {
             let item = tcx.hir().expect_item(impl_hir_id);
-            let span = if let ItemKind::Impl(.., Some(ref tr), _, _) = item.node {
+            let span = if let ItemKind::Impl(.., Some(ref tr), _, _) = item.kind {
                 tr.path.span
             } else {
                 span
@@ -116,7 +116,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: DefId) {
         }
         Err(CopyImplementationError::NotAnAdt) => {
             let item = tcx.hir().expect_item(impl_hir_id);
-            let span = if let ItemKind::Impl(.., ref ty, _) = item.node {
+            let span = if let ItemKind::Impl(.., ref ty, _) = item.kind {
                 ty.span
             } else {
                 span
@@ -481,7 +481,7 @@ pub fn coerce_unsized_info<'tcx>(gcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUn
                     return err_info;
                 } else if diff_fields.len() > 1 {
                     let item = gcx.hir().expect_item(impl_hir_id);
-                    let span = if let ItemKind::Impl(.., Some(ref t), _, _) = item.node {
+                    let span = if let ItemKind::Impl(.., Some(ref t), _, _) = item.kind {
                         t.path.span
                     } else {
                         gcx.hir().span(impl_hir_id)
index d2651317da948f069d7a05c9480ce62a2eac86d5..90cedb455e3dd11f8e30bf9b3338056ee7b4fd69 100644 (file)
@@ -49,7 +49,7 @@ struct InherentCollect<'tcx> {
 
 impl ItemLikeVisitor<'v> for InherentCollect<'tcx> {
     fn visit_item(&mut self, item: &hir::Item) {
-        let ty = match item.node {
+        let ty = match item.kind {
             hir::ItemKind::Impl(.., None, ref ty, _) => ty,
             _ => return
         };
index 04b59a63e1d8ae788b7628c0639180f816dbff10..0aae8fbe131781862d2b9292cc9cae585d083332 100644 (file)
@@ -84,7 +84,7 @@ fn check_for_overlapping_inherent_impls(&self, ty_def_id: DefId) {
 
 impl ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
     fn visit_item(&mut self, item: &'v hir::Item) {
-        match item.node {
+        match item.kind {
             hir::ItemKind::Enum(..) |
             hir::ItemKind::Struct(..) |
             hir::ItemKind::Trait(..) |
index 8969bf894e0f6e86c874dcc0c57b31873b0e0347..667fa50a7cfa4c79a6953ef08b969a5feb893b0b 100644 (file)
@@ -24,7 +24,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
     fn visit_item(&mut self, item: &hir::Item) {
         let def_id = self.tcx.hir().local_def_id(item.hir_id);
         // "Trait" impl
-        if let hir::ItemKind::Impl(.., Some(_), _, _) = item.node {
+        if let hir::ItemKind::Impl(.., Some(_), _, _) = item.kind {
             debug!("coherence2::orphan check: trait impl {}",
                    self.tcx.hir().node_to_string(item.hir_id));
             let trait_ref = self.tcx.impl_trait_ref(def_id).unwrap();
index 07fbfddd96e434e248fd323b3f56d5df41069cb7..b7cc6feee4453eee521e79f823dea7b4ee002965 100644 (file)
@@ -71,7 +71,7 @@ fn check_unsafety_coherence(&mut self,
 
 impl ItemLikeVisitor<'v> for UnsafetyChecker<'tcx> {
     fn visit_item(&mut self, item: &'v hir::Item) {
-        if let hir::ItemKind::Impl(unsafety, polarity, _, ref generics, ..) = item.node {
+        if let hir::ItemKind::Impl(unsafety, polarity, _, ref generics, ..) = item.kind {
             self.check_unsafety_coherence(item, Some(generics), unsafety, polarity);
         }
     }
index 019f39ed6e1c8a383a0c76f06611c93a7deb2f0d..28c275e2d75abeca5684bffd38bc0477e3180e14 100644 (file)
@@ -288,7 +288,7 @@ fn type_param_predicates(
         Node::ImplItem(item) => &item.generics,
 
         Node::Item(item) => {
-            match item.node {
+            match item.kind {
                 ItemKind::Fn(.., ref generics, _)
                 | ItemKind::Impl(_, _, _, ref generics, ..)
                 | ItemKind::TyAlias(_, ref generics)
@@ -403,7 +403,7 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::HirId) {
     let it = tcx.hir().expect_item(item_id);
     debug!("convert: item {} with id {}", it.ident, it.hir_id);
     let def_id = tcx.hir().local_def_id(item_id);
-    match it.node {
+    match it.kind {
         // These don't define types.
         hir::ItemKind::ExternCrate(_)
         | hir::ItemKind::Use(..)
@@ -474,7 +474,7 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::HirId) {
             tcx.generics_of(def_id);
             tcx.type_of(def_id);
             tcx.predicates_of(def_id);
-            if let hir::ItemKind::Fn(..) = it.node {
+            if let hir::ItemKind::Fn(..) = it.kind {
                 tcx.fn_sig(def_id);
             }
         }
@@ -638,7 +638,7 @@ fn adt_def(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::AdtDef {
     };
 
     let repr = ReprOptions::new(tcx, def_id);
-    let (kind, variants) = match item.node {
+    let (kind, variants) = match item.kind {
         ItemKind::Enum(ref def, _) => {
             let mut distance_from_explicit = 0;
             let variants = def.variants
@@ -707,7 +707,7 @@ fn super_predicates_of(
         _ => bug!("trait_node_id {} is not an item", trait_hir_id),
     };
 
-    let (generics, bounds) = match item.node {
+    let (generics, bounds) = match item.kind {
         hir::ItemKind::Trait(.., ref generics, ref supertraits, _) => (generics, supertraits),
         hir::ItemKind::TraitAlias(ref generics, ref supertraits) => (generics, supertraits),
         _ => span_bug!(item.span, "super_predicates invoked on non-trait"),
@@ -753,7 +753,7 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::TraitDef {
     let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
     let item = tcx.hir().expect_item(hir_id);
 
-    let (is_auto, unsafety) = match item.node {
+    let (is_auto, unsafety) = match item.kind {
         hir::ItemKind::Trait(is_auto, unsafety, ..) => (is_auto == hir::IsAuto::Yes, unsafety),
         hir::ItemKind::TraitAlias(..) => (false, hir::Unsafety::Normal),
         _ => span_bug!(item.span, "trait_def_of_item invoked on non-trait"),
@@ -878,7 +878,7 @@ fn has_late_bound_regions<'tcx>(
             }
             _ => None,
         },
-        Node::Item(item) => match item.node {
+        Node::Item(item) => match item.kind {
             hir::ItemKind::Fn(ref fn_decl, .., ref generics, _) => {
                 has_late_bound_regions(tcx, generics, fn_decl)
             }
@@ -918,7 +918,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
             kind: hir::ExprKind::Closure(..),
             ..
         }) => Some(tcx.closure_base_def_id(def_id)),
-        Node::Item(item) => match item.node {
+        Node::Item(item) => match item.kind {
             ItemKind::OpaqueTy(hir::OpaqueTy { impl_trait_fn, .. }) => impl_trait_fn,
             _ => None,
         },
@@ -935,7 +935,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
         Node::ImplItem(item) => &item.generics,
 
         Node::Item(item) => {
-            match item.node {
+            match item.kind {
                 ItemKind::Fn(.., ref generics, _) | ItemKind::Impl(_, _, _, ref generics, ..) => {
                     generics
                 }
@@ -1265,7 +1265,7 @@ pub fn checked_type_of(tcx: TyCtxt<'_>, def_id: DefId, fail: bool) -> Option<Ty<
         },
 
         Node::Item(item) => {
-            match item.node {
+            match item.kind {
                 ItemKind::Static(ref ty, .., body_id)
                 | ItemKind::Const(ref ty, body_id) => {
                     if let hir::TyKind::Infer = ty.kind {
@@ -1325,7 +1325,7 @@ pub fn checked_type_of(tcx: TyCtxt<'_>, def_id: DefId, fail: bool) -> Option<Ty<
                     span_bug!(
                         item.span,
                         "compute_type_of_item: unexpected item type: {:?}",
-                        item.node
+                        item.kind
                     );
                 }
             }
@@ -1794,7 +1794,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
             ..
         })
         | Item(hir::Item {
-            node: ItemKind::Fn(decl, header, _, _),
+            kind: ItemKind::Fn(decl, header, _, _),
             ..
         }) => match get_infer_ret_ty(&decl.output) {
             Some(ty) => {
@@ -1878,7 +1878,7 @@ fn impl_trait_ref(tcx: TyCtxt<'_>, def_id: DefId) -> Option<ty::TraitRef<'_>> {
     let icx = ItemCtxt::new(tcx, def_id);
 
     let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
-    match tcx.hir().expect_item(hir_id).node {
+    match tcx.hir().expect_item(hir_id).kind {
         hir::ItemKind::Impl(.., ref opt_trait_ref, _, _) => {
             opt_trait_ref.as_ref().map(|ast_trait_ref| {
                 let selfty = tcx.type_of(def_id);
@@ -1893,7 +1893,7 @@ fn impl_polarity(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ImplPolarity {
     let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
     let is_rustc_reservation = tcx.has_attr(def_id, sym::rustc_reservation_impl);
     let item = tcx.hir().expect_item(hir_id);
-    match &item.node {
+    match &item.kind {
         hir::ItemKind::Impl(_, hir::ImplPolarity::Negative, ..) => {
             if is_rustc_reservation {
                 tcx.sess.span_err(item.span, "reservation impls can't be negative");
@@ -2076,7 +2076,7 @@ fn extend<I: IntoIterator<Item = (ty::Predicate<'tcx>, Span)>>(&mut self, iter:
         },
 
         Node::Item(item) => {
-            match item.node {
+            match item.kind {
                 ItemKind::Impl(_, _, defaultness, ref generics, ..) => {
                     if defaultness.is_default() {
                         is_default_impl_trait = tcx.impl_trait_ref(def_id);
@@ -2310,7 +2310,7 @@ fn extend<I: IntoIterator<Item = (ty::Predicate<'tcx>, Span)>>(&mut self, iter:
     // in trait checking. See `setup_constraining_predicates`
     // for details.
     if let Node::Item(&Item {
-        node: ItemKind::Impl(..),
+        kind: ItemKind::Impl(..),
         ..
     }) = node
     {
@@ -2417,7 +2417,7 @@ fn is_foreign_item(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
 fn static_mutability(tcx: TyCtxt<'_>, def_id: DefId) -> Option<hir::Mutability> {
     match tcx.hir().get_if_local(def_id) {
         Some(Node::Item(&hir::Item {
-            node: hir::ItemKind::Static(_, mutbl, _), ..
+            kind: hir::ItemKind::Static(_, mutbl, _), ..
         })) |
         Some(Node::ForeignItem( &hir::ForeignItem {
             node: hir::ForeignItemKind::Static(_, mutbl), ..
index 8f661112caa15f19994b21d22135e15bfc43baa9..ab660caa222ae800a49364888288c5ba4f29fbca 100644 (file)
@@ -78,7 +78,7 @@ struct ImplWfCheck<'tcx> {
 
 impl ItemLikeVisitor<'tcx> for ImplWfCheck<'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item) {
-        if let hir::ItemKind::Impl(.., ref impl_item_refs) = item.node {
+        if let hir::ItemKind::Impl(.., ref impl_item_refs) = item.kind {
             let impl_def_id = self.tcx.hir().local_def_id(item.hir_id);
             enforce_impl_params_are_constrained(self.tcx,
                                                 impl_def_id,
index dbff1e91617e526848d87922c278b1842475f4d0..00be1c84599a355563e2feb8b205eb3b302334e3 100644 (file)
@@ -162,7 +162,7 @@ fn check_main_fn_ty(tcx: TyCtxt<'_>, main_def_id: DefId) {
     match main_t.kind {
         ty::FnDef(..) => {
             if let Some(Node::Item(it)) = tcx.hir().find(main_id) {
-                if let hir::ItemKind::Fn(.., ref generics, _) = it.node {
+                if let hir::ItemKind::Fn(.., ref generics, _) = it.kind {
                     let mut error = false;
                     if !generics.params.is_empty() {
                         let msg = "`main` function is not allowed to have generic \
@@ -227,7 +227,7 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: DefId) {
     match start_t.kind {
         ty::FnDef(..) => {
             if let Some(Node::Item(it)) = tcx.hir().find(start_id) {
-                if let hir::ItemKind::Fn(.., ref generics, _) = it.node {
+                if let hir::ItemKind::Fn(.., ref generics, _) = it.kind {
                     let mut error = false;
                     if !generics.params.is_empty() {
                         struct_span_err!(tcx.sess, generics.span, E0132,
index 88091d0da0e49eec7486abe5de6535fdd8fb0861..433d04ffa64ff93ebe9f7e0dddfb16f6716092e6 100644 (file)
@@ -66,7 +66,7 @@ fn visit_item(&mut self, item: &hir::Item) {
         };
 
         let mut item_required_predicates = RequiredPredicates::default();
-        match item.node {
+        match item.kind {
             hir::ItemKind::Union(..) | hir::ItemKind::Enum(..) | hir::ItemKind::Struct(..) => {
                 let adt_def = self.tcx.adt_def(item_did);
 
index 59aac5c7ffd3f4635bcad0aa163544033fb44d8b..cdb83eb328ac23ca27facfab41ac5b832d3b7b5c 100644 (file)
@@ -30,7 +30,7 @@ fn inferred_outlives_of(
         .expect("expected local def-id");
 
     match tcx.hir().get(id) {
-        Node::Item(item) => match item.node {
+        Node::Item(item) => match item.kind {
             hir::ItemKind::Struct(..) | hir::ItemKind::Enum(..) | hir::ItemKind::Union(..) => {
                 let crate_map = tcx.inferred_outlives_crate(LOCAL_CRATE);
 
index 2bd00172efb3a16fabbe5de21f2eab9f42bb9ed6..4dcb467e32b0139b41ec15984bd6aa9fcb22412b 100644 (file)
@@ -68,7 +68,7 @@ pub fn add_constraints_from_crate<'a, 'tcx>(terms_cx: TermsContext<'a, 'tcx>)
 
 impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for ConstraintContext<'a, 'tcx> {
     fn visit_item(&mut self, item: &hir::Item) {
-        match item.node {
+        match item.kind {
             hir::ItemKind::Struct(ref struct_def, _) |
             hir::ItemKind::Union(ref struct_def, _) => {
                 self.visit_node_helper(item.hir_id);
index 8145a97a020d79cdd17e00bc12b20413ca81f462..b3c0bee50f3c6fb40e44ee7091813f04eb13ea4c 100644 (file)
@@ -49,7 +49,7 @@ fn variances_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[ty::Variance] {
         span_bug!(tcx.hir().span(id), "asked to compute variance for wrong kind of item")
     };
     match tcx.hir().get(id) {
-        Node::Item(item) => match item.node {
+        Node::Item(item) => match item.kind {
             hir::ItemKind::Enum(..) |
             hir::ItemKind::Struct(..) |
             hir::ItemKind::Union(..) |
index 3511a6596221dd05a3eff1e41579830993fe887e..0489cd90c83c18f9a2841fc1d69efd5e13f24088 100644 (file)
@@ -131,7 +131,7 @@ fn visit_item(&mut self, item: &hir::Item) {
         debug!("add_inferreds for item {}",
                self.tcx.hir().node_to_string(item.hir_id));
 
-        match item.node {
+        match item.kind {
             hir::ItemKind::Struct(ref struct_def, _) |
             hir::ItemKind::Union(ref struct_def, _) => {
                 self.add_inferreds_for_item(item.hir_id);
index 479c8c37283052538e70cc8905146475652dd369..532c5f67bf3baecf036ec5908acfba8f34e5efcb 100644 (file)
@@ -333,7 +333,7 @@ pub fn build_impl(cx: &DocContext<'_>, did: DefId, attrs: Option<Attrs<'_>>,
     }
 
     let for_ = if let Some(hir_id) = tcx.hir().as_local_hir_id(did) {
-        match tcx.hir().expect_item(hir_id).node {
+        match tcx.hir().expect_item(hir_id).kind {
             hir::ItemKind::Impl(.., ref t, _) => {
                 t.clean(cx)
             }
@@ -355,7 +355,7 @@ pub fn build_impl(cx: &DocContext<'_>, did: DefId, attrs: Option<Attrs<'_>>,
 
     let predicates = tcx.explicit_predicates_of(did);
     let (trait_items, generics) = if let Some(hir_id) = tcx.hir().as_local_hir_id(did) {
-        match tcx.hir().expect_item(hir_id).node {
+        match tcx.hir().expect_item(hir_id).kind {
             hir::ItemKind::Impl(.., ref gen, _, _, ref item_ids) => {
                 (
                     item_ids.iter()
@@ -481,7 +481,7 @@ fn build_macro(cx: &DocContext<'_>, did: DefId, name: ast::Name) -> clean::ItemE
     let imported_from = cx.tcx.original_crate_name(did.krate);
     match cx.cstore.load_macro_untracked(did, cx.sess()) {
         LoadedMacro::MacroDef(def) => {
-            let matchers: hir::HirVec<Span> = if let ast::ItemKind::MacroDef(ref def) = def.node {
+            let matchers: hir::HirVec<Span> = if let ast::ItemKind::MacroDef(ref def) = def.kind {
                 let tts: Vec<_> = def.stream().into_trees().collect();
                 tts.chunks(4).map(|arm| arm[0].span()).collect()
             } else {
index 161b1a996a9c09392ad0bd4d4196c613f5cd716b..026a76f0894199f5a0928b175b145167ae8a0e17 100644 (file)
@@ -275,7 +275,7 @@ fn clean(&self, cx: &DocContext<'_>) -> ExternalCrate {
         let primitives = if root.is_local() {
             cx.tcx.hir().krate().module.item_ids.iter().filter_map(|&id| {
                 let item = cx.tcx.hir().expect_item(id.id);
-                match item.node {
+                match item.kind {
                     hir::ItemKind::Mod(_) => {
                         as_primitive(Res::Def(
                             DefKind::Mod,
@@ -319,7 +319,7 @@ fn clean(&self, cx: &DocContext<'_>) -> ExternalCrate {
         let keywords = if root.is_local() {
             cx.tcx.hir().krate().module.item_ids.iter().filter_map(|&id| {
                 let item = cx.tcx.hir().expect_item(id.id);
-                match item.node {
+                match item.kind {
                     hir::ItemKind::Mod(_) => {
                         as_keyword(Res::Def(
                             DefKind::Mod,
@@ -2868,7 +2868,7 @@ fn clean(&self, cx: &DocContext<'_>) -> Type {
             TyKind::Tup(ref tys) => Tuple(tys.clean(cx)),
             TyKind::Def(item_id, _) => {
                 let item = cx.tcx.hir().expect_item(item_id.id);
-                if let hir::ItemKind::OpaqueTy(ref ty) = item.node {
+                if let hir::ItemKind::OpaqueTy(ref ty) = item.kind {
                     ImplTrait(ty.bounds.clean(cx))
                 } else {
                     unreachable!()
@@ -2889,7 +2889,7 @@ fn clean(&self, cx: &DocContext<'_>) -> Type {
                     // Substitute private type aliases
                     if let Some(hir_id) = cx.tcx.hir().as_local_hir_id(def_id) {
                         if !cx.renderinfo.borrow().access_levels.is_exported(def_id) {
-                            alias = Some(&cx.tcx.hir().expect_item(hir_id).node);
+                            alias = Some(&cx.tcx.hir().expect_item(hir_id).kind);
                         }
                     }
                 };
index 424239c9982373b25a4981f800dd8a07b8ff1992..6576165b6ce74ddd071e2fafa2987c7f6d2b5689 100644 (file)
@@ -425,7 +425,7 @@ pub fn make_test(s: &str,
             match parser.parse_item() {
                 Ok(Some(item)) => {
                     if !found_main {
-                        if let ast::ItemKind::Fn(..) = item.node {
+                        if let ast::ItemKind::Fn(..) = item.kind {
                             if item.ident.name == sym::main {
                                 found_main = true;
                             }
@@ -433,7 +433,7 @@ pub fn make_test(s: &str,
                     }
 
                     if !found_extern_crate {
-                        if let ast::ItemKind::ExternCrate(original) = item.node {
+                        if let ast::ItemKind::ExternCrate(original) = item.kind {
                             // This code will never be reached if `cratename` is none because
                             // `found_extern_crate` is initialized to `true` if it is none.
                             let cratename = cratename.unwrap();
@@ -446,7 +446,7 @@ pub fn make_test(s: &str,
                     }
 
                     if !found_macro {
-                        if let ast::ItemKind::Mac(..) = item.node {
+                        if let ast::ItemKind::Mac(..) = item.kind {
                             found_macro = true;
                         }
                     }
@@ -882,7 +882,7 @@ fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'thi
     }
 
     fn visit_item(&mut self, item: &'hir hir::Item) {
-        let name = if let hir::ItemKind::Impl(.., ref ty, _) = item.node {
+        let name = if let hir::ItemKind::Impl(.., ref ty, _) = item.kind {
             self.map.hir_to_pretty_string(ty.hir_id)
         } else {
             item.ident.to_string()
index ee330cb32111e545d7b24bc1255ccdb1457d6cea..8cf5fbe849f558be6ef964ab10b629a33e32c491 100644 (file)
@@ -320,7 +320,7 @@ fn inherits_doc_hidden(cx: &core::DocContext<'_>, mut node: hir::HirId) -> bool
         if !self.view_item_stack.insert(res_hir_id) { return false }
 
         let ret = match tcx.hir().get(res_hir_id) {
-            Node::Item(&hir::Item { node: hir::ItemKind::Mod(ref m), .. }) if glob => {
+            Node::Item(&hir::Item { kind: hir::ItemKind::Mod(ref m), .. }) if glob => {
                 let prev = mem::replace(&mut self.inlining, true);
                 for i in &m.item_ids {
                     let i = self.cx.tcx.hir().expect_item(i.id);
@@ -361,7 +361,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item,
             self.store_path(def_id);
         }
 
-        match item.node {
+        match item.kind {
             hir::ItemKind::ForeignMod(ref fm) => {
                 for item in &fm.items {
                     self.visit_foreign_item(item, None, om);
index 684a2f15c62fe3888da31319738ddf74f754d15a..15b30352e4609967b7be959db40f2e0e1b224db8 100644 (file)
@@ -2269,7 +2269,7 @@ pub struct Item {
     pub ident: Ident,
     pub attrs: Vec<Attribute>,
     pub id: NodeId,
-    pub node: ItemKind,
+    pub kind: ItemKind,
     pub vis: Visibility,
     pub span: Span,
 
index 0b6cf30bd27d248207397ef3338ae9f62e4faff9..34b5b1e5b5c84ce9c657425b2a3f7ec8d235f871 100644 (file)
@@ -13,7 +13,7 @@ pub enum EntryPointType {
 // Beware, this is duplicated in librustc/middle/entry.rs, make sure to keep
 // them in sync.
 pub fn entry_point_type(item: &Item, depth: usize) -> EntryPointType {
-    match item.node {
+    match item.kind {
         ItemKind::Fn(..) => {
             if attr::contains_name(&item.attrs, sym::start) {
                 EntryPointType::Start
index 692849eb8cf80ee0c70acb61fa4f2260d3445ac4..54cfb80573e5c572d35bb3f045ce9eee3421713e 100644 (file)
@@ -222,7 +222,7 @@ pub fn expect_variant(self) -> ast::Variant {
 
     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,
index a2a7571c4407471b1386e8da42cb3341b13787d8..6b93d045588b9242b62080aecb23cf6fc3704e3d 100644 (file)
@@ -567,14 +567,14 @@ pub fn fn_decl(&self, inputs: Vec<ast::Param>, output: ast::FunctionRetTy) -> P<
     }
 
     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,
index d90839ac7fdcf92d02dcb094cc856dbda6b3f567..bc073a667951fbd5ef5abcd0ebb65b041912102c 100644 (file)
@@ -293,7 +293,7 @@ pub fn expand_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
         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 @@ pub fn expand_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
         })]);
 
         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 @@ fn extract_proc_macro_attr_input(&self, tokens: TokenStream, span: Span) -> Toke
     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 @@ struct DisallowMacros<'a> {
 
         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 @@ fn visit_block(&mut self, block: &mut P<Block>) {
                                      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(),
index c24f6a666039fffeed8c05c9f247c990647e7c9c..aec4a683141203e7ba00102cb37a41fb94405192 100644 (file)
@@ -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!(),
     };
index cb4c685dabe0daa02d238273fc8b08055bcc7134..a06de0f551795f42a2eb940c3a5e5be97f74024f 100644 (file)
@@ -48,7 +48,7 @@ fn mac_placeholder() -> ast::Mac {
         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 @@ fn flat_map_generic_param(
     }
 
     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 @@ fn visit_block(&mut self, block: &mut P<ast::Block>) {
 
     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,
         });
index 47b17ced8163e653a4832cd5936d0846d1916e41..e17bbf79fd5e064d1d6e2278080c5cc7422f4564 100644 (file)
@@ -107,7 +107,7 @@ fn expand(&self,
                 return Vec::new()
             }
         };
-        match item.node {
+        match item.kind {
             ItemKind::Struct(..) |
             ItemKind::Enum(..) |
             ItemKind::Union(..) => {},
index 1729ae7eae865d9ff89f1d587c0561193c0cec10..2ed4404fb3ce68b0b831653dba7f2096598934a2 100644 (file)
@@ -302,7 +302,7 @@ fn visit_name(&mut self, sp: Span, name: ast::Name) {
     }
 
     fn visit_item(&mut self, i: &'a ast::Item) {
-        match i.node {
+        match i.kind {
             ast::ItemKind::ForeignMod(ref foreign_module) => {
                 self.check_abi(foreign_module.abi, i.span);
             }
index 0a42fc0cdfd7c65b75e68afb0b0870b5e6c4a612..c448aa980c61b177606f55754d0962de14e6fbe5 100644 (file)
@@ -994,7 +994,7 @@ pub fn noop_visit_crate<T: MutVisitor>(krate: &mut Crate, vis: &mut T) {
             id: DUMMY_NODE_ID,
             vis: respan(span.shrink_to_lo(), VisibilityKind::Public),
             span,
-            node: ItemKind::Mod(module),
+            kind: ItemKind::Mod(module),
             tokens: None,
         });
         let items = vis.flat_map_item(item);
@@ -1004,8 +1004,8 @@ pub fn noop_visit_crate<T: MutVisitor>(krate: &mut Crate, vis: &mut T) {
             let module = Mod { inner: span, items: vec![], inline: true };
             Crate { module, attrs: vec![], span }
         } else if len == 1 {
-            let Item { attrs, span, node, .. } = items.into_iter().next().unwrap().into_inner();
-            match node {
+            let Item { attrs, span, kind, .. } = items.into_iter().next().unwrap().into_inner();
+            match kind {
                 ItemKind::Mod(module) => Crate { module, attrs, span },
                 _ => panic!("visitor converted a module to not a module"),
             }
@@ -1018,11 +1018,11 @@ pub fn noop_visit_crate<T: MutVisitor>(krate: &mut Crate, vis: &mut T) {
 // Mutates one item into possibly many items.
 pub fn noop_flat_map_item<T: MutVisitor>(mut item: P<Item>, visitor: &mut T)
                                          -> SmallVec<[P<Item>; 1]> {
-    let Item { ident, attrs, id, node, vis, span, tokens: _ } = item.deref_mut();
+    let Item { ident, attrs, id, kind, vis, span, tokens: _ } = item.deref_mut();
     visitor.visit_ident(ident);
     visit_attrs(attrs, visitor);
     visitor.visit_id(id);
-    visitor.visit_item_kind(node);
+    visitor.visit_item_kind(kind);
     visitor.visit_vis(vis);
     visitor.visit_span(span);
 
index 62cb836e31ea6373931232ba46f102e01df7ee48..ec5d00e0952d79925c18b2b3ad3619cdc87fce66 100644 (file)
@@ -761,7 +761,7 @@ pub fn maybe_annotate_with_ascription(
             );
             if !items.is_empty() {
                 let previous_item = &items[items.len() - 1];
-                let previous_item_kind_name = match previous_item.node {
+                let previous_item_kind_name = match previous_item.kind {
                     // Say "braced struct" because tuple-structs and
                     // braceless-empty-struct declarations do take a semicolon.
                     ItemKind::Struct(..) => Some("braced struct"),
index 27b0325db12156ced926d9bb7f8dfaf2ccc98d8f..83721a2866aad4a65df35ed2719bd383434a5d65 100644 (file)
@@ -1949,13 +1949,13 @@ fn complain_if_pub_macro(&self, vis: &VisibilityKind, sp: Span) {
         }
     }
 
-    fn mk_item(&self, span: Span, ident: Ident, node: ItemKind, vis: Visibility,
+    fn mk_item(&self, span: Span, ident: Ident, kind: ItemKind, vis: Visibility,
                attrs: Vec<Attribute>) -> P<Item> {
         P(Item {
             ident,
             attrs,
             id: DUMMY_NODE_ID,
-            node,
+            kind,
             vis,
             span,
             tokens: None,
index 7b7148588501339386d566ca0d82833a4ca12243..3bdb9227b4edd1cfa853a09bf7ede2024c10068f 100644 (file)
@@ -299,7 +299,7 @@ fn out_of_line_mod() {
             &sess,
         ).unwrap().unwrap();
 
-        if let ast::ItemKind::Mod(ref m) = item.node {
+        if let ast::ItemKind::Mod(ref m) = item.kind {
             assert!(m.items.len() == 2);
         } else {
             panic!();
index 5bf5842e3f7dbae1406ff5a1373db2ed629d891d..675490552e59c03bda37b8c448a51576bfe41c41 100644 (file)
@@ -1142,7 +1142,7 @@ fn print_associated_type(&mut self,
         self.maybe_print_comment(item.span.lo());
         self.print_outer_attributes(&item.attrs);
         self.ann.pre(self, AnnNode::Item(item));
-        match item.node {
+        match item.kind {
             ast::ItemKind::ExternCrate(orig_name) => {
                 self.head(visibility_qualified(&item.vis, "extern crate"));
                 if let Some(orig_name) = orig_name {
index 477852e5df1552129a16202f86af886ffa17abc6..ea6d27d4f29f59fb8f82b81c14a1eaae8b0686ff 100644 (file)
@@ -230,7 +230,7 @@ pub fn walk_trait_ref<'a, V: Visitor<'a>>(visitor: &mut V, trait_ref: &'a TraitR
 pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
     visitor.visit_vis(&item.vis);
     visitor.visit_ident(item.ident);
-    match item.node {
+    match item.kind {
         ItemKind::ExternCrate(orig_name) => {
             if let Some(orig_name) = orig_name {
                 visitor.visit_name(item.span, orig_name);
index 9a4c540dc6f1f349ea7600e655c24edb145f31d4..9ef2c033b0784a43baaf766d7e478684a42b115c 100644 (file)
@@ -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;
index b4306a1fd16ea3e7725b171a9a9c50764ec59b54..9f75f72e820f25c8b84d58b634ea3245a3117a66 100644 (file)
@@ -409,7 +409,7 @@ pub fn expand_ext(self,
                     }
                     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 @@ pub fn expand_ext(self,
                     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())
             }
index 19a87e6dc6d745e4d471583d2258c107796c1ad5..cd2a9b61a76df395505dc7004f95e12cd08aac0b 100644 (file)
@@ -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)),
         }
index c56b3f3fc808fc057c55e5fb1221878b61636495..72fb5b47c215401af843ceed2bbe527698082e39 100644 (file)
@@ -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,
index ccdc5bd81a04b0bc133e71c0795e9ee3c01fa79a..315babceae32ce5a9844bac4183738d09f48cbb9 100644 (file)
@@ -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,
index f33c813d86cfe4e8aea1fdae5974e06e6a30af0a..9b53bcb841c67893b384dab42a85cc6b5ebd2252 100644 (file)
@@ -226,7 +226,7 @@ fn collect_bang_proc_macro(&mut self, item: &'a ast::Item) {
 
 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 @@ fn visit_item(&mut self, item: &'a ast::Item) {
         // 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,
         };
index a5d5ceb4b4fa12584c5d5c495306c5f786d907e1..5d68a92579f96cf7c0af3074ad682955a32943a0 100644 (file)
@@ -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
index 56de0c97f81c0b70c47ee1347c289beba09d35e8..fc1daa7d9b22ad54b50dd0189758e5efc5d2c3ed 100644 (file)
@@ -85,7 +85,7 @@ fn visit_crate(&mut self, c: &mut ast::Crate) {
 
         // 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 @@ fn visit_crate(&mut self, c: &mut ast::Crate) {
                 }
                 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,