diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-06-05 11:56:06 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-06-06 14:04:02 +0300 |
| commit | f745e5f9b676be02cc1dfbab0bfb338dc72b4dd3 (patch) | |
| tree | a4982d98a51c2f8358495b9b60e3a059a9e9c1cd /src/libsyntax/parse/diagnostics.rs | |
| parent | 4c5d773b4d529c6263f682513ea34ce644a8179b (diff) | |
| download | rust-f745e5f9b676be02cc1dfbab0bfb338dc72b4dd3.tar.gz rust-f745e5f9b676be02cc1dfbab0bfb338dc72b4dd3.zip | |
syntax: Remove duplicate span from `token::Ident`
Diffstat (limited to 'src/libsyntax/parse/diagnostics.rs')
| -rw-r--r-- | src/libsyntax/parse/diagnostics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/diagnostics.rs b/src/libsyntax/parse/diagnostics.rs index 1759a229cf4..7830b2ce880 100644 --- a/src/libsyntax/parse/diagnostics.rs +++ b/src/libsyntax/parse/diagnostics.rs @@ -201,12 +201,12 @@ impl<'a> Parser<'a> { self.span, &format!("expected identifier, found {}", self.this_token_descr()), ); - if let token::Ident(ident, false) = &self.token.kind { - if ident.is_raw_guess() { + if let token::Ident(name, false) = self.token.kind { + if Ident::new(name, self.span).is_raw_guess() { err.span_suggestion( self.span, "you can escape reserved keywords to use them as identifiers", - format!("r#{}", ident), + format!("r#{}", name), Applicability::MaybeIncorrect, ); } |
