diff --git a/src/pat.rs b/src/pat.rs index c029bae83..98502d0ba 100644 --- a/src/pat.rs +++ b/src/pat.rs @@ -470,7 +470,13 @@ pub(crate) mod parsing { attrs: Vec::new(), by_ref: input.parse()?, mutability: input.parse()?, - ident: input.call(Ident::parse_any)?, + ident: { + if input.peek(Token![self]) { + input.call(Ident::parse_any)? + } else { + input.parse()? + } + }, subpat: { if input.peek(Token![@]) { let at_token: Token![@] = input.parse()?;