syntax: Introduce Ident::can_be_raw
This commit is contained in:
parent
5cb5083909
commit
6ad55b3dec
10 changed files with 33 additions and 36 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue