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.
Disallow loading crates with non-ascii identifier name.
- Loading branch information
Showing
5 changed files
with
53 additions
and
0 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,6 @@ | ||
#![feature(non_ascii_idents)] | ||
|
||
extern crate ьаг; //~ ERROR cannot load a crate with a non-ascii name `ьаг` | ||
//~| ERROR can't find crate for `ьаг` | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.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,15 @@ | ||
error: cannot load a crate with a non-ascii name `ьаг` | ||
--> $DIR/crate_name_nonascii_forbidden-1.rs:3:1 | ||
| | ||
LL | extern crate ьаг; | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0463]: can't find crate for `ьаг` | ||
--> $DIR/crate_name_nonascii_forbidden-1.rs:3:1 | ||
| | ||
LL | extern crate ьаг; | ||
| ^^^^^^^^^^^^^^^^^ can't find crate | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0463`. |
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,9 @@ | ||
// compile-flags:--extern му_сгате | ||
// edition:2018 | ||
#![feature(non_ascii_idents)] | ||
|
||
use му_сгате::baz; //~ ERROR cannot load a crate with a non-ascii name `му_сгате` | ||
//~| can't find crate for `му_сгате` | ||
|
||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.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,15 @@ | ||
error: cannot load a crate with a non-ascii name `му_сгате` | ||
--> $DIR/crate_name_nonascii_forbidden-2.rs:5:5 | ||
| | ||
LL | use му_сгате::baz; | ||
| ^^^^^^^^ | ||
|
||
error[E0463]: can't find crate for `му_сгате` | ||
--> $DIR/crate_name_nonascii_forbidden-2.rs:5:5 | ||
| | ||
LL | use му_сгате::baz; | ||
| ^^^^^^^^ can't find crate | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0463`. |