diff options
| author | Matthias KrΓΌger <matthias.krueger@famsik.de> | 2021-12-09 05:02:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-09 05:02:20 +0100 |
| commit | dc834f08ba3ac4dbfade58c8639b933bd81c6a82 (patch) | |
| tree | bdee14570a4974ef900fb2bc7b89e77dee6c75c6 /src | |
| parent | 793648ae836f80443db143d0aafc3504afdeb2d2 (diff) | |
| parent | 9d535b4c04b81a54ba4b6143829349fb46fadc4c (diff) | |
| download | rust-dc834f08ba3ac4dbfade58c8639b933bd81c6a82.tar.gz rust-dc834f08ba3ac4dbfade58c8639b933bd81c6a82.zip | |
Rollup merge of #91476 - m-ou-se:ferris-identifier, r=estebank
Improve 'cannot contain emoji' error. Before: ``` error: identifiers cannot contain emoji: `π¦` --> src/main.rs:2:9 | 2 | let π¦ = 1; | ^^ ``` After: ``` error: Ferris cannot be used as an identifier --> src/main.rs:2:9 | 2 | let π¦ = 1; | ^^ help: try using their name instead: `ferris` ``` r? `@estebank`
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/parser/emoji-identifiers.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/parser/emoji-identifiers.stderr | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/test/ui/parser/emoji-identifiers.rs b/src/test/ui/parser/emoji-identifiers.rs index ef18939bbb8..b50c046bcb2 100644 --- a/src/test/ui/parser/emoji-identifiers.rs +++ b/src/test/ui/parser/emoji-identifiers.rs @@ -13,4 +13,7 @@ fn main() { let _ = i_like_to_π_a_lot() β 4; //~ ERROR cannot find function `i_like_to_π_a_lot` in this scope //~^ ERROR identifiers cannot contain emoji //~| ERROR unknown start of token: \u{2796} + + let π¦ = 1;//~ ERROR Ferris cannot be used as an identifier + dbg!(π¦); } diff --git a/src/test/ui/parser/emoji-identifiers.stderr b/src/test/ui/parser/emoji-identifiers.stderr index 5f9263c4c13..7dc589e5563 100644 --- a/src/test/ui/parser/emoji-identifiers.stderr +++ b/src/test/ui/parser/emoji-identifiers.stderr @@ -18,6 +18,14 @@ LL | fn i_like_to_π _a_lot() -> π { LL | let _ = i_like_to_π_a_lot() β 4; | ^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `i_like_to_π _a_lot` +error: Ferris cannot be used as an identifier + --> $DIR/emoji-identifiers.rs:17:9 + | +LL | let π¦ = 1; + | ^^ help: try using their name instead: `ferris` +LL | dbg!(π¦); + | ^^ + error: identifiers cannot contain emoji: `ABigπ©π©π§π§Family` --> $DIR/emoji-identifiers.rs:1:8 | @@ -77,7 +85,7 @@ LL | π::full_ofβ¨() | function or associated item not found in `π` | help: there is an associated function with a similar name: `full_of_β¨` -error: aborting due to 9 previous errors +error: aborting due to 10 previous errors Some errors have detailed explanations: E0425, E0599. For more information about an error, try `rustc --explain E0425`. |
