Skip to content

Commit 2b49ec0

Browse files
committed
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
1 parent f22dca0 commit 2b49ec0

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/liballoc/prelude/mod.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! The alloc Prelude
2+
//!
3+
//! The purpose of this module is to alleviate imports of commonly-used
4+
//! items of the `alloc` crate by adding a glob import to the top of modules:
5+
//!
6+
//! ```
7+
//! # #![allow(unused_imports)]
8+
//! # #![feature(alloc)]
9+
//! extern crate alloc;
10+
//! use alloc::prelude::v1::*;
11+
//! ```
12+
13+
#![unstable(feature = "alloc", issue = "27783")]
14+
15+
pub mod v1;

src/liballoc/prelude.rs renamed to src/liballoc/prelude/v1.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
//! The alloc Prelude
1+
//! The first version of the prelude of `alloc` crate.
22
//!
3-
//! The purpose of this module is to alleviate imports of commonly-used
4-
//! items of the `alloc` crate by adding a glob import to the top of modules:
5-
//!
6-
//! ```
7-
//! # #![allow(unused_imports)]
8-
//! # #![feature(alloc)]
9-
//! extern crate alloc;
10-
//! use alloc::prelude::*;
11-
//! ```
3+
//! See the [module-level documentation](../index.html) for more.
124
135
#![unstable(feature = "alloc", issue = "27783")]
146

0 commit comments

Comments
 (0)