Skip to content

alloc not added to extern prelude #54392

Closed

Description

@sanmai-NL

After #50605, core and/or std are added to the extern prelude when the feature extern_prelude is enabled.

It seems to me that if, additionally, the feature alloc is enabled, alloc should be added to the prelude too.

Meta

rustc 1.30.0-nightly (20dc0c507 2018-09-19)

Activity

  1. cramertj commented on Sep 20, 2018

    @cramertj
    Member

    This was discussed on another thread (trying to track it down, but a quick look didn't turn it up) and the plan was to allow adding alloc to the extern list by providing a flag in Cargo.toml that made cargo pass a --extern alloc (with no value for x in --extern alloc=<x>). This would cause the named crates to be included in the extern prelude (if found in the link path).

  2. Nemo157 commented on Sep 21, 2018

    @Nemo157
    Contributor

    I believe the change @cramertj mentions is slated to be a post-2018 feature (since there are still design considerations for the cargo side of it). Until then use of extern crate {alloc,test,proc_macro}; are all still needed (only the last is possible on stable, the first two are unstable crates).

    Edit: see #54116 (comment) and I think
    #53130 (comment) is the most fleshed out comment on how this may look in the future.

  3. petrochenkov commented on Dec 1, 2018

    @petrochenkov
    Contributor

    alloc still requires using extern crate alloc as now documented in https://rust-lang-nursery.github.io/edition-guide/rust-2018/module-system/path-clarity.html

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language teamT-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions