From 8007dfa3b2af8f9de8cf3568ac6b3770fd9e5afd Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Fri, 15 Oct 2021 01:41:31 +0200 Subject: [PATCH] Remove alloc::prelude As per the libs team decision in #58935. Closes #58935 --- .../example/alloc_example.rs | 4 ++-- .../rustc_codegen_gcc/example/alloc_example.rs | 4 ++-- library/alloc/src/lib.rs | 1 - library/alloc/src/prelude/mod.rs | 15 --------------- library/alloc/src/prelude/v1.rs | 14 -------------- 5 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 library/alloc/src/prelude/mod.rs delete mode 100644 library/alloc/src/prelude/v1.rs diff --git a/compiler/rustc_codegen_cranelift/example/alloc_example.rs b/compiler/rustc_codegen_cranelift/example/alloc_example.rs index d0d492e9674..bc1594d82ec 100644 --- a/compiler/rustc_codegen_cranelift/example/alloc_example.rs +++ b/compiler/rustc_codegen_cranelift/example/alloc_example.rs @@ -1,10 +1,10 @@ -#![feature(start, core_intrinsics, alloc_prelude, alloc_error_handler, box_syntax)] +#![feature(start, core_intrinsics, alloc_error_handler, box_syntax)] #![no_std] extern crate alloc; extern crate alloc_system; -use alloc::prelude::v1::*; +use alloc::boxed::Box; use alloc_system::System; diff --git a/compiler/rustc_codegen_gcc/example/alloc_example.rs b/compiler/rustc_codegen_gcc/example/alloc_example.rs index bc6dd007ba0..74ea7ec4ede 100644 --- a/compiler/rustc_codegen_gcc/example/alloc_example.rs +++ b/compiler/rustc_codegen_gcc/example/alloc_example.rs @@ -1,10 +1,10 @@ -#![feature(start, box_syntax, core_intrinsics, alloc_prelude, alloc_error_handler)] +#![feature(start, box_syntax, core_intrinsics, alloc_error_handler)] #![no_std] extern crate alloc; extern crate alloc_system; -use alloc::prelude::v1::*; +use alloc::boxed::Box; use alloc_system::System; diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index e86c41b1ff8..635708fd4cf 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -189,7 +189,6 @@ mod boxed { pub mod borrow; pub mod collections; pub mod fmt; -pub mod prelude; pub mod raw_vec; pub mod rc; pub mod slice; diff --git a/library/alloc/src/prelude/mod.rs b/library/alloc/src/prelude/mod.rs deleted file mode 100644 index 0534ad3edc7..00000000000 --- a/library/alloc/src/prelude/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -//! 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_prelude)] -//! extern crate alloc; -//! use alloc::prelude::v1::*; -//! ``` - -#![unstable(feature = "alloc_prelude", issue = "58935")] - -pub mod v1; diff --git a/library/alloc/src/prelude/v1.rs b/library/alloc/src/prelude/v1.rs deleted file mode 100644 index 6a53b4ca1f6..00000000000 --- a/library/alloc/src/prelude/v1.rs +++ /dev/null @@ -1,14 +0,0 @@ -//! The first version of the prelude of `alloc` crate. -//! -//! See the [module-level documentation](../index.html) for more. - -#![unstable(feature = "alloc_prelude", issue = "58935")] - -#[unstable(feature = "alloc_prelude", issue = "58935")] -pub use crate::borrow::ToOwned; -#[unstable(feature = "alloc_prelude", issue = "58935")] -pub use crate::boxed::Box; -#[unstable(feature = "alloc_prelude", issue = "58935")] -pub use crate::string::{String, ToString}; -#[unstable(feature = "alloc_prelude", issue = "58935")] -pub use crate::vec::Vec;