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.
This commit is contained in:
Nick Cameron 2016-10-28 10:49:45 +13:00
parent 07436946b6
commit 16e1d36c08
2 changed files with 3 additions and 1 deletions

View File

@ -166,6 +166,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
loc.file.name,
loc.line);
}
error!(" master span: {:?}: `{}`", path.span, self.span.snippet(path.span));
return vec!();
}

View File

@ -1460,8 +1460,9 @@ impl<'a> MethodDef<'a> {
.iter()
.map(|v| {
let ident = v.node.name;
let sp = Span { expn_id: trait_.span.expn_id, ..v.span };
let summary = trait_.summarise_struct(cx, &v.node.data);
(ident, v.span, summary)
(ident, sp, summary)
})
.collect();
self.call_substructure_method(cx,