Improve suggestion for escaping reserved keywords
This commit is contained in:
parent
21b4a9cfdc
commit
c8198a608e
51 changed files with 134 additions and 134 deletions
|
@ -192,10 +192,10 @@ impl<'a> Parser<'a> {
|
|||
if ident.is_raw_guess()
|
||||
&& self.look_ahead(1, |t| valid_follow.contains(&t.kind)) =>
|
||||
{
|
||||
err.span_suggestion(
|
||||
ident.span,
|
||||
"you can escape reserved keywords to use them as identifiers",
|
||||
format!("r#{}", ident.name),
|
||||
err.span_suggestion_verbose(
|
||||
ident.span.shrink_to_lo(),
|
||||
&format!("escape `{}` to use it as an identifier", ident.name),
|
||||
"r#".to_owned(),
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue