Skip to content

Commit b82d280

Browse files
committed
save-analysis: dump extern crate imports
1 parent b3c3956 commit b82d280

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_save_analysis/dump_visitor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,9 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
14041404
if !self.span.filter_generated(alias_span, item.span) {
14051405
let span =
14061406
self.span_from_span(alias_span.expect("No span found for extern crate"));
1407+
let parent = self.save_ctxt.tcx.hir.opt_local_def_id(item.id)
1408+
.and_then(|id| self.save_ctxt.tcx.parent_def_id(id))
1409+
.map(::id_from_def_id);
14071410
self.dumper.import(
14081411
&Access {
14091412
public: false,
@@ -1415,7 +1418,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
14151418
span,
14161419
name: item.ident.to_string(),
14171420
value: String::new(),
1418-
parent: None,
1421+
parent,
14191422
},
14201423
);
14211424
}

0 commit comments

Comments
 (0)