-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tracking issue for alloc::prelude
#58935
Comments
… to separate it from that of the crate. New tracking issue: rust-lang#58935
Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of std This was one of the unresolved questions of rust-lang/rfcs#2480. As the RFC says this is maybe not useful in the sense that we are unlikely to ever have a second version, but making the crate a true subset makes one less issue to think about if we stabilize it and later want to merge standard library crates and have Cargo feature flags to enable or disable parts of the `std` crate. See also discussion in rust-lang#58175. Also rename the feature gate and point to a dedicated tracking issue: rust-lang#58935
Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of std This was one of the unresolved questions of rust-lang/rfcs#2480. As the RFC says this is maybe not useful in the sense that we are unlikely to ever have a second version, but making the crate a true subset makes one less issue to think about if we stabilize it and later want to merge standard library crates and have Cargo feature flags to enable or disable parts of the `std` crate. See also discussion in rust-lang#58175. Also rename the feature gate and point to a dedicated tracking issue: rust-lang#58935
The |
This is a case of #15702. (The documented example |
What exactly is blocking stabilization? Any unresolved questions? Just gaining experience with it? |
I think there was a question of how useful this is, since unlike |
I think it is very useful. I commented here after trying to use In the end, I stopped baking my own solution and used pub mod prelude {
pub mod v1 {
// Prelude
pub use __core::prelude::v1::*;
#[cfg(all(feature = "alloc", feature = "unstable"))]
pub use __alloc::prelude::v1::*;
#[cfg(all(feature = "alloc", not(feature = "unstable")))]
pub use __alloc::{
borrow::ToOwned,
boxed::Box,
// UNSTABLE: slice::SliceConcatExt,
string::String,
string::ToString,
vec::Vec,
};
// Other imports
#[cfg(feature = "alloc")]
pub use __alloc::{format, vec};
#[cfg(feature = "compat_macros")]
pub use crate::{print, println, eprint, eprintln, dbg};
}
} So if the So I think |
Why not auto inject it if |
This would add “more magic” to the language. It’s possible, but I feel it should go through the RFC process to get consensus of whether to go in that direction. |
I might actually try to write one(have no experience in writing RFCs) if you think it's needed. |
Is there any harm in stabilizing the module itself, then deciding whether to auto-import it at a later time? I'd like to be able to use the module, as right now I've literally code identical code in a module to import in the same manner. |
We discussed this in the libs meeting and felt that we shouldn't have a Until such a feature is introduced, we don't think @rfcbot close |
Team member @Amanieu has proposed to close this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Oh I hadn’t heard of that idea before. It sounds nice! |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to close, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
…htriplett Remove alloc::prelude As per the libs team decision in rust-lang#58935. Closes rust-lang#58935
…htriplett Remove alloc::prelude As per the libs team decision in rust-lang#58935. Closes rust-lang#58935
…htriplett Remove alloc::prelude As per the libs team decision in rust-lang#58935. Closes rust-lang#58935
…htriplett Remove alloc::prelude As per the libs team decision in rust-lang#58935. Closes rust-lang#58935
As per the libs team decision in rust-lang#58935. Closes rust-lang#58935
As per the libs team decision in rust-lang#58935. Closes rust-lang#58935
* Rebase fallout. * Move rustc_middle::middle::cstore to rustc_session. * Create more accurate debuginfo for vtables. Before this commit all vtables would have the same name "vtable" in debuginfo. Now they get a name that identifies the implementing type and the trait that is being implemented. * Remove alloc::prelude As per the libs team decision in rust-lang#58935. Closes rust-lang#58935 * Make hash_result an Option. * Properly check `target_features` not to trigger an assertion * Add LLVM CFI support to the Rust compiler This commit adds LLVM Control Flow Integrity (CFI) support to the Rust compiler. It initially provides forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their number of arguments. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by defining and using compatible type identifiers (see Type metadata in the design document in the tracking issue rust-lang#89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto). * Update to nightly-2021-10-30 * Add deduplication of constant values as rustc relies on LLVM doing that Co-authored-by: Camille GILLOT <gillot.camille@gmail.com> Co-authored-by: Michael Woerister <michaelwoerister@posteo> Co-authored-by: Amanieu d'Antras <amanieu@gmail.com> Co-authored-by: Yuki Okushi <yuki.okushi@huawei.com> Co-authored-by: Ramon de C Valle <rcvalle@users.noreply.github.com>
Its stability was separated from that of the
alloc
crate in #58933.CC rust-lang/rfcs#2480
The text was updated successfully, but these errors were encountered: