Skip to content

Commit c6b64f7

Browse files
committed
save-analysis: fix a few generated code errors
1 parent dc81742 commit c6b64f7

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
@@ -1323,16 +1323,18 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
13231323
self.process_macro_use(t.span, t.id);
13241324
match t.node {
13251325
ast::TyKind::Path(_, ref path) => {
1326+
if self.span.filter_generated(None, t.span) {
1327+
return;
1328+
}
1329+
13261330
if let Some(id) = self.lookup_def_id(t.id) {
13271331
let sub_span = self.span.sub_span_for_type_name(t.span);
1328-
if !self.span.filter_generated(sub_span, t.span) {
1329-
self.dumper.type_ref(TypeRefData {
1330-
span: sub_span.expect("No span found for type ref"),
1331-
ref_id: Some(id),
1332-
scope: self.cur_scope,
1333-
qualname: String::new()
1334-
}.lower(self.tcx));
1335-
}
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));
13361338
}
13371339

13381340
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)