From 212d5d43524123a45c6a88174fd3c771057faf47 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 8 May 2016 21:18:21 +0300 Subject: syntax: Refactor parsing of method declarations Fix spans and expected token lists, fix #33413 + other cosmetic improvements Add test for #33413 Convert between `Arg` and `ExplicitSelf` precisely Simplify pretty-printing for methods --- src/libsyntax_ext/deriving/generic/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 1d5fc13c720..161edcca5b2 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -864,9 +864,8 @@ impl<'a> MethodDef<'a> { let self_arg = match explicit_self.node { ast::SelfKind::Static => None, // creating fresh self id - _ => Some(ast::Arg::new_self(trait_.span, - ast::Mutability::Immutable, - keywords::SelfValue.ident())) + _ => Some(ast::Arg::from_self(explicit_self.clone(), trait_.span, + ast::Mutability::Immutable)), }; let args = { let args = arg_types.into_iter().map(|(name, ty)| { -- cgit 1.4.1-3-g733a5