]> git.lizzy.rs Git - rust.git/commitdiff
Import the `alloc` crate as `alloc_crate` in std
authorSimon Sapin <simon.sapin@exyr.org>
Tue, 3 Apr 2018 12:36:57 +0000 (14:36 +0200)
committerSimon Sapin <simon.sapin@exyr.org>
Thu, 12 Apr 2018 20:52:47 +0000 (22:52 +0200)
… to make the name `alloc` available.

18 files changed:
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/table.rs
src/libstd/collections/mod.rs
src/libstd/error.rs
src/libstd/heap.rs
src/libstd/lib.rs
src/libstd/sync/mod.rs
src/libstd/sync/mpsc/mpsc_queue.rs
src/libstd/sync/mpsc/spsc_queue.rs
src/libstd/sys/cloudabi/thread.rs
src/libstd/sys/redox/thread.rs
src/libstd/sys/unix/thread.rs
src/libstd/sys/wasm/thread.rs
src/libstd/sys/windows/process.rs
src/libstd/sys/windows/thread.rs
src/libstd/sys_common/at_exit_imp.rs
src/libstd/sys_common/process.rs
src/libstd/sys_common/thread.rs

index e0b48e565d02a8aadb3e0f13df8793cb214a82a1..73a5df8dc285ffb29fb8c0267191fe4d258329a1 100644 (file)
 use self::Entry::*;
 use self::VacantEntryState::*;
 
-use alloc::heap::Heap;
-use alloc::allocator::CollectionAllocErr;
 use cell::Cell;
-use core::heap::Alloc;
 use borrow::Borrow;
 use cmp::max;
 use fmt::{self, Debug};
 #[allow(deprecated)]
 use hash::{Hash, Hasher, BuildHasher, SipHasher13};
+use heap::{Heap, Alloc, CollectionAllocErr};
 use iter::{FromIterator, FusedIterator};
 use mem::{self, replace};
 use ops::{Deref, Index};
index fa6053d3f6d8ea136029c2b15bd2208ae7995c70..878cd82a258d2855e7c1cea5ec8eca5c5866dfcc 100644 (file)
@@ -8,17 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::heap::Heap;
-use core::heap::{Alloc, Layout};
-
 use cmp;
 use hash::{BuildHasher, Hash, Hasher};
+use heap::{Heap, Alloc, Layout, CollectionAllocErr};
 use marker;
 use mem::{align_of, size_of, needs_drop};
 use mem;
 use ops::{Deref, DerefMut};
 use ptr::{self, Unique, NonNull};
-use alloc::allocator::CollectionAllocErr;
 
 use self::BucketState::*;
 
index c7ad27d8d2675684d323f0ae04471bb7e6e5ff11..9cf73824deaaff70a8e1ea027ed21a5a73a31524 100644 (file)
 #[doc(hidden)]
 pub use ops::Bound;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::{BinaryHeap, BTreeMap, BTreeSet};
+pub use alloc_crate::{BinaryHeap, BTreeMap, BTreeSet};
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::{LinkedList, VecDeque};
+pub use alloc_crate::{LinkedList, VecDeque};
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::{binary_heap, btree_map, btree_set};
+pub use alloc_crate::{binary_heap, btree_map, btree_set};
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::{linked_list, vec_deque};
+pub use alloc_crate::{linked_list, vec_deque};
 
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::hash_map::HashMap;
@@ -446,7 +446,7 @@ pub mod range {
 }
 
 #[unstable(feature = "try_reserve", reason = "new API", issue="48043")]
-pub use alloc::allocator::CollectionAllocErr;
+pub use heap::CollectionAllocErr;
 
 mod hash;
 
index 3d0c96585b55209b95c2d38dfd0591643cbd3ca0..4edb897350efd6fb6eda506d15eb927952a77c4c 100644 (file)
 // coherence challenge (e.g., specialization, neg impls, etc) we can
 // reconsider what crate these items belong in.
 
-use alloc::allocator;
 use any::TypeId;
 use borrow::Cow;
 use cell;
 use char;
 use core::array;
 use fmt::{self, Debug, Display};
+use heap::{AllocErr, CannotReallocInPlace};
 use mem::transmute;
 use num;
 use str;
@@ -241,18 +241,18 @@ fn description(&self) -> &str { *self }
 #[unstable(feature = "allocator_api",
            reason = "the precise API and guarantees it provides may be tweaked.",
            issue = "32838")]
-impl Error for allocator::AllocErr {
+impl Error for AllocErr {
     fn description(&self) -> &str {
-        allocator::AllocErr::description(self)
+        AllocErr::description(self)
     }
 }
 
 #[unstable(feature = "allocator_api",
            reason = "the precise API and guarantees it provides may be tweaked.",
            issue = "32838")]
-impl Error for allocator::CannotReallocInPlace {
+impl Error for CannotReallocInPlace {
     fn description(&self) -> &str {
-        allocator::CannotReallocInPlace::description(self)
+        CannotReallocInPlace::description(self)
     }
 }
 
index 2cf06018087056744fa2d258d8fd4187ebcc3706..b42a1052c49f73d24cdfbb150600b2c1ace3720a 100644 (file)
@@ -12,7 +12,7 @@
 
 #![unstable(issue = "32838", feature = "allocator_api")]
 
-pub use alloc::heap::Heap;
+pub use alloc_crate::heap::Heap;
 pub use alloc_system::System;
 #[doc(inline)] pub use core::heap::*;
 
index c82d600e4a184ad00e334c8155435281c7576b0c..ef4205e7a620d522d05a15b97fca3f838a2fd8b8 100644 (file)
 
 #[macro_use]
 #[macro_reexport(vec, format)]
-extern crate alloc;
+extern crate alloc as alloc_crate;
 extern crate alloc_system;
 #[doc(masked)]
 extern crate libc;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::u64;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::boxed;
+pub use alloc_crate::boxed;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::rc;
+pub use alloc_crate::rc;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::borrow;
+pub use alloc_crate::borrow;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::fmt;
+pub use alloc_crate::fmt;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::slice;
+pub use alloc_crate::slice;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::str;
+pub use alloc_crate::str;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::string;
+pub use alloc_crate::string;
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::vec;
+pub use alloc_crate::vec;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::char;
 #[stable(feature = "i128", since = "1.26.0")]
index 289b47b34847fbd16a08ae080683e5f605e836a7..642b284c6c794bc4aa7216dffc039bac7f5729e9 100644 (file)
@@ -18,7 +18,7 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use alloc::arc::{Arc, Weak};
+pub use alloc_crate::arc::{Arc, Weak};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::sync::atomic;
 
index 296773d20f6140542cfdcfe8e7b25e4af1ee402a..df945ac3859f9c10765b275eb6e9c25327d95c74 100644 (file)
 
 pub use self::PopResult::*;
 
-use alloc::boxed::Box;
 use core::ptr;
 use core::cell::UnsafeCell;
-
+use boxed::Box;
 use sync::atomic::{AtomicPtr, Ordering};
 
 /// A result of the `pop` function.
index cc4be92276a3b2c3ac4943c00904f77164222d2c..9482f6958b311b8f45f5c6c75687f8eb8e2dc35a 100644 (file)
@@ -16,7 +16,7 @@
 
 // http://www.1024cores.net/home/lock-free-algorithms/queues/unbounded-spsc-queue
 
-use alloc::boxed::Box;
+use boxed::Box;
 use core::ptr;
 use core::cell::UnsafeCell;
 
index a22d9053b6964a1721879a7b2f7d13ada2d7398d..5d66936b2a4ff1753e5e735acc7dd9d3e3cf9f96 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::boxed::FnBox;
+use boxed::FnBox;
 use cmp;
 use ffi::CStr;
 use io;
index f20350269b7cf8a4fe8b3d5bd4d9fa928ded1ba1..110d46ca3ab0381387efe55e8d39ae97ab9c7631 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::boxed::FnBox;
+use boxed::FnBox;
 use ffi::CStr;
 use io;
 use mem;
index 2db3d4a5744e7f145ef46af5164413c4fe76a1a1..9e38880803026cc62abe7498c8d413997552ab2c 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::boxed::FnBox;
+use boxed::FnBox;
 use cmp;
 use ffi::CStr;
 use io;
index 7345843b975e4b8cd5b66c05d440b0b5a5174ad7..728e678a2e8c193c22b48270bd815a2a54f7c015 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::boxed::FnBox;
+use boxed::FnBox;
 use ffi::CStr;
 use io;
 use sys::{unsupported, Void};
index bd5507e8f896731aaa68ccad0eb818807f309e0b..be442f413740a440deee9b7fd9c7db5196b8105a 100644 (file)
@@ -31,7 +31,7 @@
 use sys::cvt;
 use sys_common::{AsInner, FromInner, IntoInner};
 use sys_common::process::{CommandEnv, EnvKey};
-use alloc::borrow::Borrow;
+use borrow::Borrow;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Command
index 4b3d1b586b5701cc0776f9ec8855669dde063a4d..b6f63303dc2f0af374d731305059f9c8a45008d5 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::boxed::FnBox;
+use boxed::FnBox;
 use io;
 use ffi::CStr;
 use mem;
index ce6fd4cb0754b1cc9297b4a97394b08aebc1356c..26da51c9825fbe8a07e9afc1dbcb0328a1fed9b8 100644 (file)
@@ -12,7 +12,7 @@
 //!
 //! Documentation can be found on the `rt::at_exit` function.
 
-use alloc::boxed::FnBox;
+use boxed::FnBox;
 use ptr;
 use sys_common::mutex::Mutex;
 
index d0c5951bd6c0a4d141d7174648b8fe9e1883169f..ddf0ebe603e08887fcef06cf22ec71051a80a37d 100644 (file)
@@ -14,7 +14,7 @@
 use ffi::{OsStr, OsString};
 use env;
 use collections::BTreeMap;
-use alloc::borrow::Borrow;
+use borrow::Borrow;
 
 pub trait EnvKey:
     From<OsString> + Into<OsString> +
index f1379b6ec637562178ccfc805eff47bb84c0595d..da6f58ef6bb7724952ef73162a75b6bec26491f0 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use alloc::boxed::FnBox;
+use boxed::FnBox;
 use env;
 use sync::atomic::{self, Ordering};
 use sys::stack_overflow;