diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2016-10-28 10:49:45 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2016-10-28 10:49:45 +1300 |
| commit | 16e1d36c0851b6cb47a215a8fe94178fd39eab04 (patch) | |
| tree | 46382f68acd89f055da626f0d7da157176a2ffe0 /src/libsyntax_ext | |
| parent | 07436946b6ee6345509b73c6e4dafb38b6a243f1 (diff) | |
| download | rust-16e1d36c0851b6cb47a215a8fe94178fd39eab04.tar.gz rust-16e1d36c0851b6cb47a215a8fe94178fd39eab04.zip | |
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.
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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, |
