Skip to content

Tracking issue for feature extern_crate_item_prelude #55599

Description

@petrochenkov

With this feature extern crate foo as bar; item placed into the crate root puts the name bar into extern prelude. This has the next effects:

  • The name is in scope in the whole crate, including inner modules, like other prelude names.
  • On 2018 edition imports can refer to that name use bar::zzz; or use ::bar::zzz;, plus non-import absolute paths can refer to it as well let z = ::bar::zzz;.

More details are available on the implementation PR - #54658.

Activity

  1. added
    T-langRelevant to the language team
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Nov 1, 2018
  2. Nemo157 commented on Nov 3, 2018

    @Nemo157
    Contributor

    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_macro everywhere).

    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
  3. SimonSapin commented on Nov 4, 2018

    @SimonSapin
    Contributor

    this appears to have no forward-compat warning

    I’ve also hit this and filed #55592

  4. steveklabnik commented on Nov 7, 2018

    @steveklabnik
    Contributor

    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?

  5. SimonSapin commented on Nov 7, 2018

    @SimonSapin
    Contributor

    @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?

  6. SimonSapin commented on Nov 7, 2018

    @SimonSapin
    Contributor

    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).

  7. self-assigned this
    on Nov 14, 2018
  8. petrochenkov commented on Nov 14, 2018

    @petrochenkov
    ContributorAuthor

    @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.

  9. added a commit that references this issue on Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-edition-2018Area: The 2018 editionB-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-rust_2018_preview`#![feature(rust_2018_preview)]`T-langRelevant to the language team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions