Improve suggestion for escaping reserved keywords
This commit is contained in:
parent
21b4a9cfdc
commit
c8198a608e
51 changed files with 134 additions and 134 deletions
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `false`
|
|||
LL | fn false() { }
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `false` to use it as an identifier
|
||||
|
|
||||
LL | fn r#false() { }
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `true`
|
|||
LL | fn true() { }
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `true` to use it as an identifier
|
||||
|
|
||||
LL | fn r#true() { }
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ LL |
|
|||
LL | return
|
||||
| ^^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `return` to use it as an identifier
|
||||
|
|
||||
LL | r#return
|
||||
|
|
||||
| ++
|
||||
|
||||
error: expected one of `.`, `=>`, `?`, or an operator, found reserved identifier `_`
|
||||
--> $DIR/issue-15980.rs:13:9
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `true`
|
|||
LL | foo!(true);
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `true` to use it as an identifier
|
||||
|
|
||||
LL | foo!(r#true);
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: invalid `struct` delimiters or `fn` call arguments
|
||||
--> $DIR/issue-44406.rs:3:9
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `for`
|
|||
LL | m::for();
|
||||
| ^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `for` to use it as an identifier
|
||||
|
|
||||
LL | m::r#for();
|
||||
| ~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ LL | impl
|
|||
LL | }
|
||||
| - the item list ends here
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `impl` to use it as an identifier
|
||||
|
|
||||
LL | r#impl
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `abstract`
|
|||
LL | let abstract = ();
|
||||
| ^^^^^^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `abstract` to use it as an identifier
|
||||
|
|
||||
LL | let r#abstract = ();
|
||||
| ~~~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `as`
|
|||
LL | let as = "foo";
|
||||
| ^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `as` to use it as an identifier
|
||||
|
|
||||
LL | let r#as = "foo";
|
||||
| ~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `break`
|
|||
LL | let break = "foo";
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `break` to use it as an identifier
|
||||
|
|
||||
LL | let r#break = "foo";
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `const`
|
|||
LL | let const = "foo";
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `const` to use it as an identifier
|
||||
|
|
||||
LL | let r#const = "foo";
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `continue`
|
|||
LL | let continue = "foo";
|
||||
| ^^^^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `continue` to use it as an identifier
|
||||
|
|
||||
LL | let r#continue = "foo";
|
||||
| ~~~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `else`
|
|||
LL | let else = "foo";
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `else` to use it as an identifier
|
||||
|
|
||||
LL | let r#else = "foo";
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `enum`
|
|||
LL | let enum = "foo";
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `enum` to use it as an identifier
|
||||
|
|
||||
LL | let r#enum = "foo";
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `final`
|
|||
LL | let final = ();
|
||||
| ^^^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `final` to use it as an identifier
|
||||
|
|
||||
LL | let r#final = ();
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `fn`
|
|||
LL | let fn = "foo";
|
||||
| ^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `fn` to use it as an identifier
|
||||
|
|
||||
LL | let r#fn = "foo";
|
||||
| ~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `for`
|
|||
LL | let for = "foo";
|
||||
| ^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `for` to use it as an identifier
|
||||
|
|
||||
LL | let r#for = "foo";
|
||||
| ~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `if`
|
|||
LL | let if = "foo";
|
||||
| ^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `if` to use it as an identifier
|
||||
|
|
||||
LL | let r#if = "foo";
|
||||
| ~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `impl`
|
|||
LL | let impl = "foo";
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `impl` to use it as an identifier
|
||||
|
|
||||
LL | let r#impl = "foo";
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `let`
|
|||
LL | let let = "foo";
|
||||
| ^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `let` to use it as an identifier
|
||||
|
|
||||
LL | let r#let = "foo";
|
||||
| ~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `loop`
|
|||
LL | let loop = "foo";
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `loop` to use it as an identifier
|
||||
|
|
||||
LL | let r#loop = "foo";
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `match`
|
|||
LL | let match = "foo";
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `match` to use it as an identifier
|
||||
|
|
||||
LL | let r#match = "foo";
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `mod`
|
|||
LL | let mod = "foo";
|
||||
| ^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `mod` to use it as an identifier
|
||||
|
|
||||
LL | let r#mod = "foo";
|
||||
| ~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `move`
|
|||
LL | let move = "foo";
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `move` to use it as an identifier
|
||||
|
|
||||
LL | let r#move = "foo";
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `override`
|
|||
LL | let override = ();
|
||||
| ^^^^^^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `override` to use it as an identifier
|
||||
|
|
||||
LL | let r#override = ();
|
||||
| ~~~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `pub`
|
|||
LL | let pub = "foo";
|
||||
| ^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `pub` to use it as an identifier
|
||||
|
|
||||
LL | let r#pub = "foo";
|
||||
| ~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `return`
|
|||
LL | let return = "foo";
|
||||
| ^^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `return` to use it as an identifier
|
||||
|
|
||||
LL | let r#return = "foo";
|
||||
| ~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `static`
|
|||
LL | let static = "foo";
|
||||
| ^^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `static` to use it as an identifier
|
||||
|
|
||||
LL | let r#static = "foo";
|
||||
| ~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `struct`
|
|||
LL | let struct = "foo";
|
||||
| ^^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `struct` to use it as an identifier
|
||||
|
|
||||
LL | let r#struct = "foo";
|
||||
| ~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `trait`
|
|||
LL | let trait = "foo";
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `trait` to use it as an identifier
|
||||
|
|
||||
LL | let r#trait = "foo";
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `try`
|
|||
LL | let try = "foo";
|
||||
| ^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `try` to use it as an identifier
|
||||
|
|
||||
LL | let r#try = "foo";
|
||||
| ~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `type`
|
|||
LL | let type = "foo";
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `type` to use it as an identifier
|
||||
|
|
||||
LL | let r#type = "foo";
|
||||
| ~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `typeof`
|
|||
LL | let typeof = ();
|
||||
| ^^^^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `typeof` to use it as an identifier
|
||||
|
|
||||
LL | let r#typeof = ();
|
||||
| ~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `unsafe`
|
|||
LL | let unsafe = "foo";
|
||||
| ^^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `unsafe` to use it as an identifier
|
||||
|
|
||||
LL | let r#unsafe = "foo";
|
||||
| ~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `use`
|
|||
LL | let use = "foo";
|
||||
| ^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `use` to use it as an identifier
|
||||
|
|
||||
LL | let r#use = "foo";
|
||||
| ~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `where`
|
|||
LL | let where = "foo";
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `where` to use it as an identifier
|
||||
|
|
||||
LL | let r#where = "foo";
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `while`
|
|||
LL | let while = "foo";
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `while` to use it as an identifier
|
||||
|
|
||||
LL | let r#while = "foo";
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found keyword `break`
|
|||
LL | pub mod break {
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `break` to use it as an identifier
|
||||
|
|
||||
LL | pub mod r#break {
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `macro`
|
|||
LL | fn macro() {
|
||||
| ^^^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `macro` to use it as an identifier
|
||||
|
|
||||
LL | fn r#macro() {
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ error: expected identifier, found reserved keyword `yield`
|
|||
LL | let mut mut yield(become, await) = r#yield(0, 0);
|
||||
| ^^^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `yield` to use it as an identifier
|
||||
|
|
||||
LL | let mut mut r#yield(become, await) = r#yield(0, 0);
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: expected identifier, found reserved keyword `become`
|
||||
--> $DIR/mut-patterns.rs:28:23
|
||||
|
|
@ -67,10 +67,10 @@ error: expected identifier, found reserved keyword `become`
|
|||
LL | let mut mut yield(become, await) = r#yield(0, 0);
|
||||
| ^^^^^^ expected identifier, found reserved keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `become` to use it as an identifier
|
||||
|
|
||||
LL | let mut mut yield(r#become, await) = r#yield(0, 0);
|
||||
| ~~~~~~~~
|
||||
| ++
|
||||
|
||||
error: expected identifier, found keyword `await`
|
||||
--> $DIR/mut-patterns.rs:28:31
|
||||
|
|
@ -78,10 +78,10 @@ error: expected identifier, found keyword `await`
|
|||
LL | let mut mut yield(become, await) = r#yield(0, 0);
|
||||
| ^^^^^ expected identifier, found keyword
|
||||
|
|
||||
help: you can escape reserved keywords to use them as identifiers
|
||||
help: escape `await` to use it as an identifier
|
||||
|
|
||||
LL | let mut mut yield(become, r#await) = r#yield(0, 0);
|
||||
| ~~~~~~~
|
||||
| ++
|
||||
|
||||
error: `mut` must be attached to each individual binding
|
||||
--> $DIR/mut-patterns.rs:28:9
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue