Skip to content

save-analysis: fix a few generated code errors #38203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1323,16 +1323,18 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
self.process_macro_use(t.span, t.id);
match t.node {
ast::TyKind::Path(_, ref path) => {
if self.span.filter_generated(None, 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);
if !self.span.filter_generated(sub_span, 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));
}
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));
}

self.write_sub_paths_truncated(path, false);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
match typ.node {
// Common case impl for a struct or something basic.
ast::TyKind::Path(None, ref path) => {
filter!(self.span_utils, None, path.span, None);
sub_span = self.span_utils.sub_span_for_type_name(path.span);
filter!(self.span_utils, sub_span, path.span, None);
type_data = self.lookup_ref_id(typ.id).map(|id| {
TypeRefData {
span: sub_span.unwrap(),
Expand Down