Skip to content
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

Tracking issue for feature extern_crate_self #56409

Closed
petrochenkov opened this issue Dec 1, 2018 · 2 comments · Fixed by #57407
Closed

Tracking issue for feature extern_crate_self #56409

petrochenkov opened this issue Dec 1, 2018 · 2 comments · Fixed by #57407
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

With this feature 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 and therefore can be used from absolute paths and imports on 2018 edition.

extern crate self as serde; // Adds local crate to extern prelude as `serde`

mod foo { ... }

// Anywhere in this crate
use serde::foo; // OK
::serde::foo; // OK

The feature's primary purpose is to resolve #54647 and support migration of proc macro crates to 2018 edition.

Implementation PR - #55275.

@petrochenkov petrochenkov added T-lang Relevant to the language team, which will review and decide on the PR/issue. B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. labels Dec 1, 2018
@mehcode
Copy link
Contributor

mehcode commented Jan 6, 2019

This would be excellent. Is there something blocking stabilization here?

The "work-around" described in a related issue gets significantly more awkward if you're expanding proc-macros in doctests. See my recent edition upgrade on diesel: https://github.com/diesel-rs/diesel/blob/af1ff2476f997d6eb04fffd58260705d77ff6b6f/diesel_derives/src/util.rs#L81-L96

@petrochenkov
Copy link
Contributor Author

petrochenkov commented Jan 6, 2019

@mehcode

Is there something blocking stabilization here?

I don't think so, someone just needs to submit a stabilization PR, and then it should go through the "official" approval by the lang team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants