Skip to content

Commit 6da7267

Browse files
committed
Auto merge of #11017 - BlackHoleFox:non-ascii-names, r=weihanglo
Update non-ASCII crate name warning message This PR fixes an outdated warning when initializing crates sometimes. ### What does this PR try to resolve? Per [a Zulip convo](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Non-ASCII.20crate.20name.20status/near/294876491) on the topic, non-ASCII crate names are no longer allowed on any toolchain since rust-lang/rust#73305, during the `non_ascii_idents` feature's development. Cargo however tells the user that they are accepted on Nightly. Rust and Cargo should agree on this point to avoid future confusion. ### How should we test and review this PR? This should be covered by the existing test that was changed but if desired its easy to test with a checkout: ``` Running `/Users/fox/x/Forks/cargo/target/release/cargo init 'ああああ'` warning: the name `ああああ` contains non-ASCII characters Non-ASCII crate names are not supported by Rust. ```
2 parents fee1c7f + b676088 commit 6da7267

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/cargo/ops/cargo_new.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ fn check_name(
253253
if restricted_names::is_non_ascii_name(name) {
254254
shell.warn(format!(
255255
"the name `{}` contains non-ASCII characters\n\
256-
Support for non-ASCII crate names is experimental and only valid \
257-
on the nightly toolchain.",
256+
Non-ASCII crate names are not supported by Rust.",
258257
name
259258
))?;
260259
}

tests/testsuite/new.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ fn non_ascii_name() {
435435
.with_stderr(
436436
"\
437437
[WARNING] the name `Привет` contains non-ASCII characters
438-
Support for non-ASCII crate names is experimental and only valid on the nightly toolchain.
438+
Non-ASCII crate names are not supported by Rust.
439439
[CREATED] binary (application) `Привет` package
440440
",
441441
)

0 commit comments

Comments
 (0)