Rollup merge of #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
This commit is contained in:
Guillaume Gomez 2016-10-28 17:05:48 +02:00 committed by GitHub
commit 1d7e1b3552
2 changed files with 3 additions and 1 deletions

View file

@ -166,6 +166,7 @@ fn process_path_prefixes(&self, path: &ast::Path) -> Vec<(Span, String)> {
loc.file.name,
loc.line);
}
error!(" master span: {:?}: `{}`", path.span, self.span.snippet(path.span));
return vec!();
}

View file

@ -1460,8 +1460,9 @@ fn expand_static_enum_method_body(&self,
.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,