]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/visit_ast.rs
Rename `Item.node` to `Item.kind`
[rust.git] / src / librustdoc / visit_ast.rs
index 35b6d9972da06a2c96e2ce875b85b49f509a43b9..8cf5fbe849f558be6ef964ab10b629a33e32c491 100644 (file)
@@ -41,7 +41,7 @@ fn def_id_to_path(
 // framework from syntax?.
 
 pub struct RustdocVisitor<'a, 'tcx> {
-    cx: &'a core::DocContext<'tcx>,
+    cx: &'a mut core::DocContext<'tcx>,
     view_item_stack: FxHashSet<hir::HirId>,
     inlining: bool,
     /// Are the current module and all of its parents public?
@@ -51,7 +51,7 @@ pub struct RustdocVisitor<'a, 'tcx> {
 
 impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
     pub fn new(
-        cx: &'a core::DocContext<'tcx>
+        cx: &'a mut core::DocContext<'tcx>
     ) -> RustdocVisitor<'a, 'tcx> {
         // If the root is re-exported, terminate all recursion.
         let mut stack = FxHashSet::default();
@@ -84,7 +84,7 @@ pub fn visit(mut self, krate: &'tcx hir::Crate) -> Module<'tcx> {
         );
         module.is_crate = true;
 
-        self.cx.renderinfo.borrow_mut().exact_paths = self.exact_paths;
+        self.cx.renderinfo.get_mut().exact_paths = self.exact_paths;
 
         module
     }
@@ -130,10 +130,10 @@ fn visit_enum_def(&mut self, it: &'tcx hir::Item,
         Enum {
             name,
             variants: def.variants.iter().map(|v| Variant {
-                name: v.node.ident.name,
-                id: v.node.id,
-                attrs: &v.node.attrs,
-                def: &v.node.data,
+                name: v.ident.name,
+                id: v.id,
+                attrs: &v.attrs,
+                def: &v.data,
                 whence: v.span,
             }).collect(),
             vis: &it.vis,
@@ -292,7 +292,7 @@ fn inherits_doc_hidden(cx: &core::DocContext<'_>, mut node: hir::HirId) -> bool
                 Res::Def(DefKind::ForeignTy, did) |
                 Res::Def(DefKind::TyAlias, did) if !self_is_hidden => {
                     self.cx.renderinfo
-                        .borrow_mut()
+                        .get_mut()
                         .access_levels.map
                         .insert(did, AccessLevel::Public);
                 },
@@ -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);