about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-02-27 22:06:26 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-03-16 23:13:15 +0300
commit6ad55b3decefd53263f20a6c575aaa85c1edcbec (patch)
tree6ad909da93cbfe48a004e134ea296ada6f84ee42 /src/libsyntax/parse/parser.rs
parent5cb5083909f19c107aec186a72b8b9104f8ca30d (diff)
downloadrust-6ad55b3decefd53263f20a6c575aaa85c1edcbec.tar.gz
rust-6ad55b3decefd53263f20a6c575aaa85c1edcbec.zip
syntax: Introduce `Ident::can_be_raw`
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 22af7d47fd0..b9510dc08b0 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -895,9 +895,7 @@ impl<'a> Parser<'a> {
                                            &format!("expected identifier, found {}",
                                                     self.this_token_descr()));
         if let token::Ident(ident, false) = &self.token {
-            if ident.is_reserved() && !ident.is_path_segment_keyword() &&
-                ident.name != keywords::Underscore.name()
-            {
+            if ident.is_raw_guess() {
                 err.span_suggestion(
                     self.span,
                     "you can escape reserved keywords to use them as identifiers",