diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2017-01-09 15:07:07 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2017-01-09 15:07:07 +1300 |
| commit | 1cfe3b1c8c19e2092dd533ee6952b817476feaa6 (patch) | |
| tree | 9487d0cdd1bb867d6ae4a1a06d06908f7ec94b27 | |
| parent | 302602bcb3c608979bb9122960fbe037d92666e9 (diff) | |
| download | rust-1cfe3b1c8c19e2092dd533ee6952b817476feaa6.tar.gz rust-1cfe3b1c8c19e2092dd533ee6952b817476feaa6.zip | |
save-analysis: fix over-zealous filter on generated code
| -rw-r--r-- | src/librustc_save_analysis/dump_visitor.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 424017ebd12..06e1a492b4d 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -1343,18 +1343,19 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll, self.process_macro_use(t.span, t.id); match t.node { ast::TyKind::Path(_, ref path) => { - if self.span.filter_generated(None, t.span) { + if generated_code(t.span) { return; } if let Some(id) = self.lookup_def_id(t.id) { - let sub_span = self.span.sub_span_for_type_name(t.span); - self.dumper.type_ref(TypeRefData { - span: sub_span.expect("No span found for type ref"), - ref_id: Some(id), - scope: self.cur_scope, - qualname: String::new() - }.lower(self.tcx)); + if let Some(sub_span) = self.span.sub_span_for_type_name(t.span) { + self.dumper.type_ref(TypeRefData { + span: sub_span, + ref_id: Some(id), + scope: self.cur_scope, + qualname: String::new() + }.lower(self.tcx)); + } } self.write_sub_paths_truncated(path); |
