-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable using non-ascii identifiers in extern blocks.
- Loading branch information
Showing
6 changed files
with
80 additions
and
3 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
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,10 @@ | ||
#![feature(extern_types)] | ||
#![feature(non_ascii_idents)] | ||
|
||
extern "C" { | ||
type 一; //~ items in `extern` blocks cannot use non-ascii identifiers | ||
fn 二(); //~ items in `extern` blocks cannot use non-ascii identifiers | ||
static 三: usize; //~ items in `extern` blocks cannot use non-ascii identifiers | ||
} | ||
|
||
fn main() {} |
34 changes: 34 additions & 0 deletions
34
src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr
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,34 @@ | ||
error: items in `extern` blocks cannot use non-ascii identifiers | ||
--> $DIR/extern_block_nonascii_forbidden.rs:5:10 | ||
| | ||
LL | extern "C" { | ||
| ---------- in this `extern` block | ||
LL | type 一; | ||
| ^^ | ||
| | ||
= note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information | ||
|
||
error: items in `extern` blocks cannot use non-ascii identifiers | ||
--> $DIR/extern_block_nonascii_forbidden.rs:6:8 | ||
| | ||
LL | extern "C" { | ||
| ---------- in this `extern` block | ||
LL | type 一; | ||
LL | fn 二(); | ||
| ^^ | ||
| | ||
= note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information | ||
|
||
error: items in `extern` blocks cannot use non-ascii identifiers | ||
--> $DIR/extern_block_nonascii_forbidden.rs:7:12 | ||
| | ||
LL | extern "C" { | ||
| ---------- in this `extern` block | ||
... | ||
LL | static 三: usize; | ||
| ^^ | ||
| | ||
= note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information | ||
|
||
error: aborting due to 3 previous errors | ||
|
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