-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix another ICE caused by improper unicode handling
- Loading branch information
Showing
5 changed files
with
82 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//@ edition:2021 | ||
|
||
macro_rules! demo2 { | ||
( $a:tt $b:tt ) => { println!("two tokens") }; | ||
} | ||
|
||
macro_rules! demo3 { | ||
( $a:tt $b:tt $c:tt ) => { println!("three tokens") }; | ||
} | ||
|
||
macro_rules! demo4 { | ||
( $a:tt $b:tt $c:tt $d:tt ) => { println!("four tokens") }; | ||
} | ||
|
||
fn main() { | ||
// Non-ascii identifiers | ||
demo2!(Ñ"foo"); //~ ERROR prefix `Ñ` is unknown | ||
demo4!(Ñ#""#); //~ ERROR prefix `Ñ` is unknown | ||
demo3!(🙃#""); | ||
//~^ ERROR prefix `🙃` is unknown | ||
//~| WARNING identifier contains an uncommon character | ||
} |
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,47 @@ | ||
error: prefix `Ñ` is unknown | ||
--> $DIR/reserved-guarded-strings-lexing.rs:17:12 | ||
| | ||
LL | demo2!(Ñ"foo"); | ||
| ^ unknown prefix | ||
| | ||
= note: prefixed identifiers and literals are reserved since Rust 2021 | ||
help: consider inserting whitespace here | ||
| | ||
LL | demo2!(Ñ "foo"); | ||
| + | ||
|
||
error: prefix `Ñ` is unknown | ||
--> $DIR/reserved-guarded-strings-lexing.rs:18:12 | ||
| | ||
LL | demo4!(Ñ#""#); | ||
| ^ unknown prefix | ||
| | ||
= note: prefixed identifiers and literals are reserved since Rust 2021 | ||
help: consider inserting whitespace here | ||
| | ||
LL | demo4!(Ñ #""#); | ||
| + | ||
|
||
error: prefix `🙃` is unknown | ||
--> $DIR/reserved-guarded-strings-lexing.rs:19:12 | ||
| | ||
LL | demo3!(🙃#""); | ||
| ^^ unknown prefix | ||
| | ||
= note: prefixed identifiers and literals are reserved since Rust 2021 | ||
help: consider inserting whitespace here | ||
| | ||
LL | demo3!(🙃 #""); | ||
| + | ||
|
||
warning: identifier contains an uncommon character: '🙃' | ||
--> $DIR/reserved-guarded-strings-lexing.rs:19:12 | ||
| | ||
LL | demo3!(🙃#""); | ||
| ^^ | ||
| | ||
= note: this character is included in the Unicode general security profile | ||
= note: `#[warn(uncommon_codepoints)]` on by default | ||
|
||
error: aborting due to 3 previous errors; 1 warning emitted | ||
|
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