about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-03-05 09:58:47 +0100
committerSimon Sapin <simon.sapin@exyr.org>2019-03-05 10:02:38 +0100
commit2b49ec0bb676f324806bb271f4115c3a1c0afaf3 (patch)
tree88cb71387b002b91fb52c1f24f530780afb52acd /src/liballoc
parentf22dca0a1bef4141e75326caacc3cd59f3d5be8e (diff)
downloadrust-2b49ec0bb676f324806bb271f4115c3a1c0afaf3.tar.gz
rust-2b49ec0bb676f324806bb271f4115c3a1c0afaf3.zip
Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of std
This was one of the unresolved questions of https://github.com/rust-lang/rfcs/pull/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 https://github.com/rust-lang/rust/pull/58175
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/prelude/mod.rs15
-rw-r--r--src/liballoc/prelude/v1.rs (renamed from src/liballoc/prelude.rs)12
2 files changed, 17 insertions, 10 deletions
diff --git a/src/liballoc/prelude/mod.rs b/src/liballoc/prelude/mod.rs
new file mode 100644
index 00000000000..44a859d31ec
--- /dev/null
+++ b/src/liballoc/prelude/mod.rs
@@ -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;
diff --git a/src/liballoc/prelude.rs b/src/liballoc/prelude/v1.rs
index 6767cf89f73..2df330d19f8 100644
--- a/src/liballoc/prelude.rs
+++ b/src/liballoc/prelude/v1.rs
@@ -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")]