Skip to content

Commit e9aa73d

Browse files
committed
Auto merge of #38203 - nrc:save-wr, r=eddyb
save-analysis: fix a few generated code errors
2 parents 51d2934 + c6b64f7 commit e9aa73d

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/librustc_save_analysis/dump_visitor.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -1326,16 +1326,18 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
13261326
self.process_macro_use(t.span, t.id);
13271327
match t.node {
13281328
ast::TyKind::Path(_, ref path) => {
1329+
if self.span.filter_generated(None, t.span) {
1330+
return;
1331+
}
1332+
13291333
if let Some(id) = self.lookup_def_id(t.id) {
13301334
let sub_span = self.span.sub_span_for_type_name(t.span);
1331-
if !self.span.filter_generated(sub_span, t.span) {
1332-
self.dumper.type_ref(TypeRefData {
1333-
span: sub_span.expect("No span found for type ref"),
1334-
ref_id: Some(id),
1335-
scope: self.cur_scope,
1336-
qualname: String::new()
1337-
}.lower(self.tcx));
1338-
}
1335+
self.dumper.type_ref(TypeRefData {
1336+
span: sub_span.expect("No span found for type ref"),
1337+
ref_id: Some(id),
1338+
scope: self.cur_scope,
1339+
qualname: String::new()
1340+
}.lower(self.tcx));
13391341
}
13401342

13411343
self.write_sub_paths_truncated(path, false);

src/librustc_save_analysis/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
250250
match typ.node {
251251
// Common case impl for a struct or something basic.
252252
ast::TyKind::Path(None, ref path) => {
253+
filter!(self.span_utils, None, path.span, None);
253254
sub_span = self.span_utils.sub_span_for_type_name(path.span);
254-
filter!(self.span_utils, sub_span, path.span, None);
255255
type_data = self.lookup_ref_id(typ.id).map(|id| {
256256
TypeRefData {
257257
span: sub_span.unwrap(),

0 commit comments

Comments
 (0)