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

Add the alloc::prelude module #52159

Merged
merged 2 commits into from
Jul 9, 2018
Merged

Conversation

SimonSapin
Copy link
Contributor

It contains the re-exports that are in std::prelude::v1 but not in core::prelude::v1.

Calling it prelude is somewhat of a misnomer since (unlike those modules in std or core) its contents are never implicitly imported in modules. Rather it is intended to be used with an explicit glob import like use alloc::prelude::*;. However there is precedent for the same misnomer with std::io::prelude, for example.

This new module is unstable with the same feature name as the alloc care. They are proposed for stabilization together in RFC rust-lang/rfcs#2480.

It contains the re-exports that are in `std::prelude::v1`
but not in `core::prelude::v1`.

Calling it prelude is somewhat of a misnomer since (unlike those modules
in `std` or `core`) its contents are never implicitly imported in modules.
Rather it is intended to be used with an explicit glob import like
`use alloc::prelude::*;`.
However there is precedent for the same misnomer with `std::io::prelude`,
for example.

This new module is unstable with the same feature name as the `alloc` care.
They are proposed for stabilization together in RFC
rust-lang/rfcs#2480
@rust-highfive
Copy link
Collaborator

r? @aidanhs

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 8, 2018
@SimonSapin
Copy link
Contributor Author

As discussed in #52119, this not using a v1 submodule in order to follow the precedent of std::io::prelude rather than that of std::prelude::v1, since this import is never inserted automatically.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 9, 2018

📌 Commit 5b795cf has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 9, 2018
@bors
Copy link
Contributor

bors commented Jul 9, 2018

⌛ Testing commit 5b795cf with merge c6807bb...

bors added a commit that referenced this pull request Jul 9, 2018
Add the `alloc::prelude` module

It contains the re-exports that are in `std::prelude::v1` but not in `core::prelude::v1`.

Calling it prelude is somewhat of a misnomer since (unlike those modules in `std` or `core`) its contents are never implicitly imported in modules. Rather it is intended to be used with an explicit glob import like `use alloc::prelude::*;`. However there is precedent for the same misnomer with `std::io::prelude`, for example.

This new module is unstable with the same feature name as the `alloc` care. They are proposed for stabilization together in RFC rust-lang/rfcs#2480.
@bors
Copy link
Contributor

bors commented Jul 9, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing c6807bb to master...

@bors bors merged commit 5b795cf into rust-lang:master Jul 9, 2018
@SimonSapin SimonSapin deleted the alloc-prelude branch July 9, 2018 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants