From c32d03f4172580e3f33e4844ed3c01234dca2d53 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 22 Dec 2014 09:04:23 -0800 Subject: std: Stabilize the prelude module This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068 --- src/libstd/thread_local/mod.rs | 21 +++++++++++---------- src/libstd/thread_local/scoped.rs | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/libstd/thread_local') diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 242dceb4256..674cb5a9805 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -37,7 +37,7 @@ #![macro_escape] #![experimental] -use prelude::*; +use prelude::v1::*; use cell::UnsafeCell; @@ -258,7 +258,7 @@ impl Key { #[cfg(any(target_os = "macos", target_os = "linux"))] mod imp { - use prelude::*; + use prelude::v1::*; use cell::UnsafeCell; use intrinsics; @@ -396,7 +396,7 @@ mod imp { #[cfg(not(any(target_os = "macos", target_os = "linux")))] mod imp { - use prelude::*; + use prelude::v1::*; use cell::UnsafeCell; use mem; @@ -469,8 +469,9 @@ mod imp { #[cfg(test)] mod tests { - use prelude::*; + use prelude::v1::*; + use comm::{channel, Sender}; use cell::UnsafeCell; use thread::Thread; @@ -492,7 +493,7 @@ mod tests { *f.get() = 2; }); let (tx, rx) = channel(); - spawn(move|| { + let _t = Thread::spawn(move|| { FOO.with(|f| unsafe { assert_eq!(*f.get(), 1); }); @@ -512,7 +513,7 @@ mod tests { }); let (tx, rx) = channel(); - spawn(move|| unsafe { + let _t = Thread::spawn(move|| unsafe { let mut tx = Some(tx); FOO.with(|f| { *f.get() = Some(Foo(tx.take().unwrap())); @@ -562,7 +563,7 @@ mod tests { Thread::spawn(move|| { drop(S1); - }).join(); + }).join().ok().unwrap(); } #[test] @@ -580,7 +581,7 @@ mod tests { Thread::spawn(move|| unsafe { K1.with(|s| *s.get() = Some(S1)); - }).join(); + }).join().ok().unwrap(); } #[test] @@ -605,7 +606,7 @@ mod tests { } let (tx, rx) = channel(); - spawn(move|| unsafe { + let _t = Thread::spawn(move|| unsafe { let mut tx = Some(tx); K1.with(|s| *s.get() = Some(S1(tx.take().unwrap()))); }); @@ -615,7 +616,7 @@ mod tests { #[cfg(test)] mod dynamic_tests { - use prelude::*; + use prelude::v1::*; use cell::RefCell; use collections::HashMap; diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs index 756c86c2115..a06048aa706 100644 --- a/src/libstd/thread_local/scoped.rs +++ b/src/libstd/thread_local/scoped.rs @@ -40,7 +40,7 @@ #![macro_escape] -use prelude::*; +use prelude::v1::*; // macro hygiene sure would be nice, wouldn't it? #[doc(hidden)] pub use self::imp::KeyInner; @@ -238,7 +238,7 @@ mod imp { #[cfg(test)] mod tests { use cell::Cell; - use prelude::*; + use prelude::v1::*; #[test] fn smoke() { -- cgit 1.4.1-3-g733a5