Repository navigation
Tracking issue for feature extern_crate_item_prelude #55599
Description
Activity
- addedT-langRelevant to the language teamRelevant to the language teamB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-rust_2018_preview`#![feature(rust_2018_preview)]``#![feature(rust_2018_preview)]`
on Nov 1, 2018 Is this intended to be stable for the initial 2018 release? It seems important for a nice experience with proc-macros (otherwise you must use
crate::proc_macroeverywhere).If not, this appears to have no forward-compat warning when building under 2015, which causes a failure to migrate with
cargo fix:error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658) --> interp-macros/src/lib.rs:12:5 | 12 | use proc_macro::TokenStream; | ^^^^^^^^^^ | = help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
Reacted by Carol (Nichols || Goulding) and Dainslef Teithis appears to have no forward-compat warning
I’ve also hit this and filed #55592
Knowing if this will ship in 1.31 or not is important for the book, for the reasons that @Nemo157 mentioned. Could we maybe get an answer here?
@petrochenkov, @rust-lang/lang Are there any blockers for stabilizing this feature? How do you feel about backporting its stabilization to 1.31 beta? Should FCP be proposed now?
In servo/servo#22086 I’ve migrated a number of Servo crates to the 2018 editions, but I left out proc-macro and plugin crates in part because of this issue (or lack of other good way to deal with crate dependencies not known to Cargo).
@aturon and @steveklabnik wanted to stabilize this for the edition release as well (on #edition-planning discord channel).
This should be ready for stabilization and backport to 1.31 beta once #55884 lands (or some fixes for this feature are extracted from that PR).
I'll prepare a stabilization report.- added a commit that references this issue
on Nov 21, 2018
With this feature
extern crate foo as bar;item placed into the crate root puts the namebarinto extern prelude. This has the next effects:use bar::zzz;oruse ::bar::zzz;, plus non-import absolute paths can refer to it as welllet z = ::bar::zzz;.More details are available on the implementation PR - #54658.