diff options
| author | Andy Russell <arussell123@gmail.com> | 2017-12-14 21:23:20 -0500 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2017-12-15 16:57:51 -0500 |
| commit | b82d2809fda9c75c5144d6ada0bc25a9f50a1bb4 (patch) | |
| tree | 0ce407169a68eb6891caed9bd9400a0b2cf9bf6a | |
| parent | b3c39560a43c72fa792241297467e43cf5d1c789 (diff) | |
save-analysis: dump extern crate imports
| -rw-r--r-- | src/librustc_save_analysis/dump_visitor.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 08ad96c6fe8..11e2135d2de 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -1404,6 +1404,9 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc if !self.span.filter_generated(alias_span, item.span) { let span = self.span_from_span(alias_span.expect("No span found for extern crate")); + let parent = self.save_ctxt.tcx.hir.opt_local_def_id(item.id) + .and_then(|id| self.save_ctxt.tcx.parent_def_id(id)) + .map(::id_from_def_id); self.dumper.import( &Access { public: false, @@ -1415,7 +1418,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc span, name: item.ident.to_string(), value: String::new(), - parent: None, + parent, }, ); } |
