-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
experiment: Support aliasing local crate root in extern prelude #55275
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
cc @rust-lang/lang |
Seems fine by me (but I can't speak for everyone in the team). |
r? @eddyb maybe? I know too little about name resolution. |
☔ The latest upstream changes (presumably #54658) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #54683) made this pull request unmergeable. Please resolve the merge conflicts. |
Implementation LGTM. @rfcbot fcp merge |
Team member @eddyb has proposed to merge this. The next step is review by the rest of the tagged teams:
No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
☔ The latest upstream changes (presumably #56032) made this pull request unmergeable. Please resolve the merge conflicts. |
(Tagged @pnkfelix as they are on PTO) |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
3fc0609
to
0681e33
Compare
The final comment period, with a disposition to merge, as per the review above, is now complete. |
@bors r=eddyb |
📌 Commit 549bd45 has been approved by |
experiment: Support aliasing local crate root in extern prelude This PR provides some minimally invasive solution for the 2018 edition migration issue described in #54647 and affecting proc macro crates. `extern crate NAME as RENAME;` now accepts `NAME`=`self` and interprets it as referring to the local crate. As with other `extern crate` items, `RENAME` in this case gets into extern prelude in accordance with #54658, thus resolving #54647. ```rust extern crate self as serde; // Adds local crate to extern prelude as `serde` ``` This solution doesn't introduce any new syntax and has minimal maintenance cost, so it can be easily deprecated if something better is found in the future. Closes #54647
@petrochenkov Hmm; If we are adding the unstable feature |
I'll add it today (maybe in this PR if checkin fails). UPDATE: Done in #56412. |
Tracking issue: #56409. |
☀️ Test successful - status-appveyor, status-travis |
This PR provides some minimally invasive solution for the 2018 edition migration issue described in #54647 and affecting proc macro crates.
extern crate NAME as RENAME;
now acceptsNAME
=self
and interprets it as referring to the local crate.As with other
extern crate
items,RENAME
in this case gets into extern prelude in accordance with #54658, thus resolving #54647.This solution doesn't introduce any new syntax and has minimal maintenance cost, so it can be easily deprecated if something better is found in the future.
Closes #54647