Skip to content

Commit

Permalink
Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of std
Browse files Browse the repository at this point in the history
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 #58175
  • Loading branch information
SimonSapin committed Mar 5, 2019
1 parent f22dca0 commit 2b49ec0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
15 changes: 15 additions & 0 deletions src/liballoc/prelude/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//! The alloc Prelude
//!
//! The purpose of this module is to alleviate imports of commonly-used
//! items of the `alloc` crate by adding a glob import to the top of modules:
//!
//! ```
//! # #![allow(unused_imports)]
//! # #![feature(alloc)]
//! extern crate alloc;
//! use alloc::prelude::v1::*;
//! ```
#![unstable(feature = "alloc", issue = "27783")]

pub mod v1;
12 changes: 2 additions & 10 deletions src/liballoc/prelude.rs → src/liballoc/prelude/v1.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
//! The alloc Prelude
//! The first version of the prelude of `alloc` crate.
//!
//! The purpose of this module is to alleviate imports of commonly-used
//! items of the `alloc` crate by adding a glob import to the top of modules:
//!
//! ```
//! # #![allow(unused_imports)]
//! # #![feature(alloc)]
//! extern crate alloc;
//! use alloc::prelude::*;
//! ```
//! See the [module-level documentation](../index.html) for more.
#![unstable(feature = "alloc", issue = "27783")]

Expand Down

0 comments on commit 2b49ec0

Please sign in to comment.