Skip to content

Commit 1d7e1b3

Browse files
Rollup merge of rust-lang#37436 - nrc:save-span-errs, r=petrochenkov
Give variant spans used in derives the correct expansion id This fixes a problem in save-analysis where it mistakes a path to a variant as the variant itself. r? @petrochenkov
2 parents f12e66e + 16e1d36 commit 1d7e1b3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: src/librustc_save_analysis/dump_visitor.rs

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
166166
loc.file.name,
167167
loc.line);
168168
}
169+
error!(" master span: {:?}: `{}`", path.span, self.span.snippet(path.span));
169170
return vec!();
170171
}
171172

Diff for: src/libsyntax_ext/deriving/generic/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1460,8 +1460,9 @@ impl<'a> MethodDef<'a> {
14601460
.iter()
14611461
.map(|v| {
14621462
let ident = v.node.name;
1463+
let sp = Span { expn_id: trait_.span.expn_id, ..v.span };
14631464
let summary = trait_.summarise_struct(cx, &v.node.data);
1464-
(ident, v.span, summary)
1465+
(ident, sp, summary)
14651466
})
14661467
.collect();
14671468
self.call_substructure_method(cx,

0 commit comments

Comments
 (0)