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

alloc not added to extern prelude #54392

Closed
sanmai-NL opened this issue Sep 20, 2018 · 3 comments
Closed

alloc not added to extern prelude #54392

sanmai-NL opened this issue Sep 20, 2018 · 3 comments
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@sanmai-NL
Copy link

sanmai-NL commented Sep 20, 2018

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)

@cramertj
Copy link
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).

@Nemo157
Copy link
Member

Nemo157 commented Sep 21, 2018

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.

@estebank estebank added T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 21, 2018
@petrochenkov
Copy link
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
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants