forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#137356 - nik-rev:FERRIS, r=compiler-errors
Ferris 🦀 Identifier naming conventions You cannot use Ferris as an identifier in Rust, this code will suggest to correct the 🦀 to `ferris`: ```rs fn main() { let 🦀 = 4; } ``` But it also suggests to correct to `ferris` in these cases, too: ```rs struct 🦀 {} fn main() {} ``` ^ suggests: `ferris` ~ with this PR: `Ferris` ```rs static 🦀: &str = "ferris!"; fn main() {} ``` ^ suggests: `ferris` ~ with this PR: `FERRIS` This is my first pull requests here!
- Loading branch information
Showing
6 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
static mut 🦀: &str = "ferris!";//~ ERROR Ferris cannot be used as an identifier | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: Ferris cannot be used as an identifier | ||
--> $DIR/ferris-static-mut.rs:1:12 | ||
| | ||
LL | static mut 🦀: &str = "ferris!"; | ||
| ^^ help: try using their name instead: `FERRIS` | ||
|
||
error: aborting due to 1 previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
struct 🦀 {}//~ ERROR Ferris cannot be used as an identifier | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: Ferris cannot be used as an identifier | ||
--> $DIR/ferris-struct.rs:1:8 | ||
| | ||
LL | struct 🦀 {} | ||
| ^^ help: try using their name instead: `Ferris` | ||
|
||
error: aborting due to 1 previous error | ||
|