X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustdoc%2Fvisit_ast.rs;h=8cf5fbe849f558be6ef964ab10b629a33e32c491;hb=7bc94cc3c2ccef8b4d393910bb978a6487db1202;hp=903ed3aae147016e8173e54a798296fa2c639ebc;hpb=6bce50f390bbdfca66966c26adec42b927670f4f;p=rust.git diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 903ed3aae14..8cf5fbe849f 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -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, 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 } @@ -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);