Skip to content

Commit 9991fdf

Browse files
committed
Fix nested imports not included in the save_analysis output
1 parent f0e5c95 commit 9991fdf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc_save_analysis/dump_visitor.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
12521252
root_item: &'l ast::Item,
12531253
prefix: &ast::Path) {
12541254
let path = &use_tree.prefix;
1255-
let access = access_from!(self.save_ctxt, root_item);
1255+
1256+
// The access is calculated using the current tree ID, but with the root tree's visibility
1257+
// (since nested trees don't have their own visibility).
1258+
let access = Access {
1259+
public: root_item.vis == ast::Visibility::Public,
1260+
reachable: self.save_ctxt.analysis.access_levels.is_reachable(id),
1261+
};
12561262

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

0 commit comments

Comments
 (0)