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

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
7 participants
@petrochenkov
Contributor

petrochenkov commented Oct 22, 2018

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.

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

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Oct 22, 2018

r? @michaelwoerister

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

@petrochenkov

This comment has been minimized.

Contributor

petrochenkov commented Oct 22, 2018

@Centril

This comment has been minimized.

Contributor

Centril commented Oct 22, 2018

Seems fine by me (but I can't speak for everyone in the team).
The syntax=>semantics are fairly obvious and it seems like a nice reuse of the syntax that we have.

@michaelwoerister

This comment has been minimized.

Contributor

michaelwoerister commented Oct 23, 2018

r? @eddyb maybe? I know too little about name resolution.

@bors

This comment has been minimized.

Contributor

bors commented Oct 25, 2018

☔️ The latest upstream changes (presumably #54658) made this pull request unmergeable. Please resolve the merge conflicts.

@bors

This comment has been minimized.

Contributor

bors commented Oct 28, 2018

☔️ The latest upstream changes (presumably #54683) made this pull request unmergeable. Please resolve the merge conflicts.

@eddyb

eddyb approved these changes Nov 3, 2018

@eddyb

This comment has been minimized.

Member

eddyb commented Nov 3, 2018

Implementation LGTM.

@rfcbot fcp merge

@rfcbot

This comment has been minimized.

rfcbot commented Nov 3, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment