Skip to content

Commit 76bc5e1

Browse files
committed
Auto merge of #38937 - nrc:save-ty-fix, r=nikomatsakis
save-analysis: fix over-zealous filter on generated code
2 parents 9749df5 + 1cfe3b1 commit 76bc5e1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/librustc_save_analysis/dump_visitor.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -1343,18 +1343,19 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
13431343
self.process_macro_use(t.span, t.id);
13441344
match t.node {
13451345
ast::TyKind::Path(_, ref path) => {
1346-
if self.span.filter_generated(None, t.span) {
1346+
if generated_code(t.span) {
13471347
return;
13481348
}
13491349

13501350
if let Some(id) = self.lookup_def_id(t.id) {
1351-
let sub_span = self.span.sub_span_for_type_name(t.span);
1352-
self.dumper.type_ref(TypeRefData {
1353-
span: sub_span.expect("No span found for type ref"),
1354-
ref_id: Some(id),
1355-
scope: self.cur_scope,
1356-
qualname: String::new()
1357-
}.lower(self.tcx));
1351+
if let Some(sub_span) = self.span.sub_span_for_type_name(t.span) {
1352+
self.dumper.type_ref(TypeRefData {
1353+
span: sub_span,
1354+
ref_id: Some(id),
1355+
scope: self.cur_scope,
1356+
qualname: String::new()
1357+
}.lower(self.tcx));
1358+
}
13581359
}
13591360

13601361
self.write_sub_paths_truncated(path);

0 commit comments

Comments
 (0)