diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-18 23:50:21 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-18 23:50:21 +1100 |
| commit | dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5 (patch) | |
| tree | e9c32f2e58b3462a23dd9c472d2f236640b78811 /src/liballoc | |
| parent | 6c065fc8cb036785f61ff03e05c1563cbb2dd081 (diff) | |
| parent | 47f91a9484eceef10536d4caac6ef578cd254567 (diff) | |
| download | rust-dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5.tar.gz rust-dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5.zip | |
Manual merge of #22475 - alexcrichton:rollup, r=alexcrichton
One windows bot failed spuriously.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 16 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 8 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 10 |
3 files changed, 11 insertions, 23 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 0617c604121..3830d7fe295 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -35,14 +35,14 @@ //! //! ``` //! use std::sync::Arc; -//! use std::thread::Thread; +//! use std::thread; //! //! let five = Arc::new(5); //! //! for _ in 0..10 { //! let five = five.clone(); //! -//! Thread::spawn(move || { +//! thread::spawn(move || { //! println!("{:?}", five); //! }); //! } @@ -52,14 +52,14 @@ //! //! ``` //! use std::sync::{Arc, Mutex}; -//! use std::thread::Thread; +//! use std::thread; //! //! let five = Arc::new(Mutex::new(5)); //! //! for _ in 0..10 { //! let five = five.clone(); //! -//! Thread::spawn(move || { +//! thread::spawn(move || { //! let mut number = five.lock().unwrap(); //! //! *number += 1; @@ -95,7 +95,7 @@ use heap::deallocate; /// /// ```rust /// use std::sync::Arc; -/// use std::thread::Thread; +/// use std::thread; /// /// fn main() { /// let numbers: Vec<_> = (0..100u32).map(|i| i as f32).collect(); @@ -104,7 +104,7 @@ use heap::deallocate; /// for _ in 0..10 { /// let child_numbers = shared_numbers.clone(); /// -/// Thread::spawn(move || { +/// thread::spawn(move || { /// let local_numbers = child_numbers.as_slice(); /// /// // Work with the local numbers @@ -621,7 +621,7 @@ mod tests { use std::option::Option::{Some, None}; use std::sync::atomic; use std::sync::atomic::Ordering::{Acquire, SeqCst}; - use std::thread::Thread; + use std::thread; use std::vec::Vec; use super::{Arc, Weak, weak_count, strong_count}; use std::sync::Mutex; @@ -648,7 +648,7 @@ mod tests { let (tx, rx) = channel(); - let _t = Thread::spawn(move || { + let _t = thread::spawn(move || { let arc_v: Arc<Vec<i32>> = rx.recv().unwrap(); assert_eq!((*arc_v)[3], 4); }); diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 87106041c69..b3c2638f3ae 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -126,11 +126,3 @@ pub fn oom() -> ! { // optimize it out). #[doc(hidden)] pub fn fixme_14344_be_sure_to_link_to_collections() {} - -// NOTE: remove after next snapshot -#[cfg(all(stage0, not(test)))] -#[doc(hidden)] -mod std { - pub use core::fmt; - pub use core::option; -} diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index ab3c0901bc9..f361c36ec8f 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -170,7 +170,7 @@ struct RcBox<T> { weak: Cell<usize> } -/// An immutable reference-counted pointer type. +/// A reference-counted pointer type over an immutable value. /// /// See the [module level documentation](./index.html) for more details. #[unsafe_no_drop_flag] @@ -776,9 +776,7 @@ impl<T> RcBoxPtr<T> for Rc<T> { // the contract anyway. // This allows the null check to be elided in the destructor if we // manipulated the reference count in the same function. - if cfg!(not(stage0)) { // NOTE remove cfg after next snapshot - assume(!self._ptr.is_null()); - } + assume(!self._ptr.is_null()); &(**self._ptr) } } @@ -792,9 +790,7 @@ impl<T> RcBoxPtr<T> for Weak<T> { // the contract anyway. // This allows the null check to be elided in the destructor if we // manipulated the reference count in the same function. - if cfg!(not(stage0)) { // NOTE remove cfg after next snapshot - assume(!self._ptr.is_null()); - } + assume(!self._ptr.is_null()); &(**self._ptr) } } |
