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

Comments

Projects
None yet
2 participants
@petrochenkov
Copy link
Contributor

petrochenkov commented Dec 1, 2018

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.

@mehcode

This comment has been minimized.

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

This comment has been minimized.

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.

Centril added a commit to Centril/rust that referenced this issue Jan 26, 2019

Rollup merge of rust-lang#57407 - mehcode:stabilize-extern-crate-self…
…, r=Centril

Stabilize extern_crate_self

Fixes rust-lang#56409

@bors bors closed this in #57407 Jan 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.