syntax: Introduce Ident::can_be_raw
This commit is contained in:
parent
5cb5083909
commit
6ad55b3dec
10 changed files with 33 additions and 36 deletions
|
|
@ -1,3 +1,4 @@
|
|||
fn self_test(r#self: u32) {
|
||||
//~^ ERROR `r#self` is not currently supported.
|
||||
fn main() {
|
||||
let r#self;
|
||||
//~^ ERROR `self` cannot be a raw identifier
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: `r#self` is not currently supported.
|
||||
--> $DIR/raw-literal-self.rs:1:14
|
||||
error: `self` cannot be a raw identifier
|
||||
--> $DIR/raw-literal-self.rs:2:9
|
||||
|
|
||||
LL | fn self_test(r#self: u32) {
|
||||
| ^^^^^^
|
||||
LL | let r#self;
|
||||
| ^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
fn underscore_test(r#_: u32) {
|
||||
//~^ ERROR `r#_` is not currently supported.
|
||||
fn main() {
|
||||
let r#_;
|
||||
//~^ ERROR `_` cannot be a raw identifier
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: `r#_` is not currently supported.
|
||||
--> $DIR/raw-literal-underscore.rs:1:20
|
||||
error: `_` cannot be a raw identifier
|
||||
--> $DIR/raw-literal-underscore.rs:2:9
|
||||
|
|
||||
LL | fn underscore_test(r#_: u32) {
|
||||
| ^^^
|
||||
LL | let r#_;
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error: proc macro panicked
|
|||
LL | invalid_raw_ident!();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: message: `"self"` is not a valid raw identifier
|
||||
= help: message: `self` cannot be a raw identifier
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue