// 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?
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();
);
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
}
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,
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);
},
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);
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);
om.foreigns.push(ForeignItem {
id: item.hir_id,
name: renamed.unwrap_or(item.ident).name,
- kind: &item.node,
+ kind: &item.kind,
vis: &item.vis,
attrs: &item.attrs,
whence: item.span