Skip to content

Commit

Permalink
Fix nested imports not included in the save_analysis output
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Dec 30, 2017
1 parent f0e5c95 commit 9991fdf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
root_item: &'l ast::Item,
prefix: &ast::Path) {
let path = &use_tree.prefix;
let access = access_from!(self.save_ctxt, root_item);

// The access is calculated using the current tree ID, but with the root tree's visibility
// (since nested trees don't have their own visibility).
let access = Access {
public: root_item.vis == ast::Visibility::Public,
reachable: self.save_ctxt.analysis.access_levels.is_reachable(id),
};

// The parent def id of a given use tree is always the enclosing item.
let parent = self.save_ctxt.tcx.hir.opt_local_def_id(id)
Expand Down

0 comments on commit 9991fdf

Please sign in to comment.