-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add the alloc::prelude
module
#52119
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
Conversation
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
I swear I always get the "insta-stable" PRs... 😝 |
Yeah, I may be cutting a corner here. I don’t mind changing this to unstable and proposing stabilization together with the crate in 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
Changed to unstable with the same feature name as the crate. |
I'm still not 100% sure this is the end state we want to be in, but I think this is a good option to have at least. In any case it's an unstable module so we have time to tinker! Should this perhaps follow the standard of core/std prelude and be in a |
It’s not injected automatically anywhere, so I rather followed the example of |
Er sorry, was cleaning out branches on the |
It contains the re-exports that are in
std::prelude::v1
but not incore::prelude::v1
.Calling it prelude is somewhat of a misnomer since (unlike those modules in
std
orcore
) its contents are never implicitly imported in modules. Rather it is intended to be used with an explicit glob import likeuse alloc::prelude::*;
. However there is precedent for the same misnomer withstd::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.