Skip to content

Disallow loading crates with non-ascii identifier name. - #73305

Merged
bors merged 1 commit into
rust-lang:masterfrom
crlf0710:disallow_loading_monsters
Jun 19, 2020
Merged

Disallow loading crates with non-ascii identifier name.#73305
bors merged 1 commit into
rust-lang:masterfrom
crlf0710:disallow_loading_monsters

Conversation

@crlf0710

Copy link
Copy Markdown
Member

This turns off external crate loading with non-ascii identifier names.

cc #55467.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 13, 2020
@crlf0710

Copy link
Copy Markdown
MemberAuthor

r? @petrochenkov

@rust-highfive

This comment has been minimized.

@crlf0710
crlf0710force-pushed the disallow_loading_monsters branch from 61cfc0c to c245f46CompareJune 13, 2020 07:50
@petrochenkov

Copy link
Copy Markdown
Contributor

Could you put the error into fn resolve_crate instead and make it non-fatal?
I think that would be a better place.

@petrochenkovpetrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 13, 2020
@crlf0710
crlf0710force-pushed the disallow_loading_monsters branch from c245f46 to 7149485CompareJune 15, 2020 16:00
@crlf0710

Copy link
Copy Markdown
MemberAuthor

Updated addressing the review comments.

@crlf0710crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 15, 2020
Comment threadsrc/librustc_metadata/creader.rs Outdated
@petrochenkovpetrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 15, 2020
@crlf0710
crlf0710force-pushed the disallow_loading_monsters branch from 7149485 to 1990f97CompareJune 16, 2020 13:36
@crlf0710crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 16, 2020
@petrochenkov

Copy link
Copy Markdown
Contributor

Thanks!
@bors r+

@bors

bors commented Jun 16, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 1990f97 has been approved by petrochenkov

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 16, 2020
@RalfJung

Copy link
Copy Markdown
Member

@bors rollup

@crlf0710crlf0710 added the F-non_ascii_idents `#![feature(non_ascii_idents)]` label Jun 17, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 17, 2020
… r=petrochenkov
Disallow loading crates with non-ascii identifier name.
This turns off external crate loading with non-ascii identifier names.
cc rust-lang#55467.
tmandry added a commit to tmandry/rust that referenced this pull request Jun 17, 2020
… r=petrochenkov
Disallow loading crates with non-ascii identifier name.
This turns off external crate loading with non-ascii identifier names.
cc rust-lang#55467.
@tmandrytmandry mentioned this pull request Jun 17, 2020
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 18, 2020
… r=petrochenkov
Disallow loading crates with non-ascii identifier name.
This turns off external crate loading with non-ascii identifier names.
cc rust-lang#55467.
@RalfJungRalfJung mentioned this pull request Jun 18, 2020
@RalfJungRalfJung mentioned this pull request Jun 19, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 19, 2020
Rollup of 13 pull requests
Successful merges:
- rust-lang#70740 (Enabling static-pie for musl)
- rust-lang#72331 (Report error when casting an C-like enum implementing Drop)
- rust-lang#72486 (Fix asinh of negative values)
- rust-lang#72497 (tag/niche terminology cleanup)
- rust-lang#72999 (Create self-contained directory and move there some of external binaries/libs)
- rust-lang#73130 (Remove const prop for indirects)
- rust-lang#73142 (Ensure std benchmarks get tested.)
- rust-lang#73305 (Disallow loading crates with non-ascii identifier name.)
- rust-lang#73346 (Add rust specific features to print target features)
- rust-lang#73362 (Test that bounds checks are elided when slice len is checked up-front)
- rust-lang#73459 (Reduce pointer casts in Box::into_boxed_slice)
- rust-lang#73464 (Document format correction)
- rust-lang#73479 (Minor tweaks to liballoc)
Failed merges:
r? @ghost
@bors
bors merged commit 3b4bec2 into rust-lang:masterJun 19, 2020
bors added a commit to rust-lang/cargo that referenced this pull request Aug 23, 2022
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.
```
@cuvipercuviper added this to the 1.46 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-non_ascii_idents`#![feature(non_ascii_idents)]`S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@crlf0710@rust-highfive@petrochenkov@bors@RalfJung@cuviper@matthewjasper