-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc: Add support for extern crate foo as bar
#23546
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
Oh dear... I've already implemented this as well 😱 I think I'll support your version as it's less intrusive, but I'll keep mine around for reference. (For the record, I took a slightly different approach. My branch pretty much enforces that crate names are identifiers right away instead of patching around it.) |
Oh oops, sorry about that! I think that we'll definitely want to move towards your approach soon, but for now we want to try to smooth the transition. I don't expect the code to allow hyphens to stick around longer than a week! |
I've also got crates.io support implemented, just need to deal with some straggler crates that violate the new rule. I will work on a cargo implementation for the RFC soon as well (and this should not be r+'d until that's ready). |
I've updated with a new warning that's emitted whenever a crate name contains a hyphen. This should cover the case @lfairy did that I forgot where you pass |
Ok, crates.io is now rejecting uploads of crates that only differ in hyphens vs underscores |
I should also note that this adds a bunch of warnings to the build because we have some |
r? @brson |
@alexcrichton That sounds good. I'm swamped with course work right now, so I don't mind you taking it from here ;) |
Ok, I have implemented cargo support and this should be ready to go. |
@bors r+ p=1 |
📌 Commit 19742ea has been approved by |
⌛ Testing commit 19742ea with merge 694183f... |
⛄ The build was interrupted to prioritize another pull request. |
🔒 Merge conflict |
☔ The latest upstream changes (presumably #23654) made this pull request unmergeable. Please resolve the merge conflicts. |
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc rust-lang#23533
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc rust-lang#23533
💔 Test failed - auto-win-32-nopt-t |
@bors: retry On Tue, Mar 24, 2015 at 6:21 PM, bors notifications@github.com wrote:
|
⚡ Previous build results for auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt are reusable. Rebuilding only auto-win-32-nopt-t... |
⛄ The build was interrupted to prioritize another pull request. |
@bors: force |
This PR actually passed except for a known spurious failure, so I'm going to merge manually. |
The compiler will now issue a warning for crates that have syntax of the form
extern crate "foo" as bar
, but it will still continue to accept this syntax.Additionally, the string
foo-bar
will match the crate namefoo_bar
to assistin the transition period as well.
This patch will land hopefully in tandem with a Cargo patch that will start
translating all crate names to have underscores instead of hyphens.
cc #23533