From 16e1d36c0851b6cb47a215a8fe94178fd39eab04 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Fri, 28 Oct 2016 10:49:45 +1300 Subject: 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. --- src/libsyntax_ext/deriving/generic/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index bc47d8f4e61..687f8c902f2 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -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, -- cgit 1.4.1-3-g733a5