about summary refs log tree commit diff
path: root/src/libstd/thread_local
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-22 09:04:23 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-02 08:54:06 -0800
commit56290a004493a5d2e211f056601533253497df60 (patch)
treeab0e7c227f9ba155ea5bfd0390cada43062924c1 /src/libstd/thread_local
parent71b46b18a274edc7f7fb60b490e5ebbb9c911462 (diff)
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
Diffstat (limited to 'src/libstd/thread_local')
-rw-r--r--src/libstd/thread_local/mod.rs21
-rw-r--r--src/libstd/thread_local/scoped.rs4
2 files changed, 13 insertions, 12 deletions
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
index 14dd2a1ac9b..9d4e7936de2 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;
 
@@ -248,7 +248,7 @@ impl<T: 'static> Key<T> {
 
 #[cfg(any(target_os = "macos", target_os = "linux"))]
 mod imp {
-    use prelude::*;
+    use prelude::v1::*;
 
     use cell::UnsafeCell;
     use intrinsics;
@@ -380,7 +380,7 @@ mod imp {
 
 #[cfg(not(any(target_os = "macos", target_os = "linux")))]
 mod imp {
-    use prelude::*;
+    use prelude::v1::*;
 
     use cell::UnsafeCell;
     use mem;
@@ -453,8 +453,9 @@ mod imp {
 
 #[cfg(test)]
 mod tests {
-    use prelude::*;
+    use prelude::v1::*;
 
+    use comm::{channel, Sender};
     use cell::UnsafeCell;
     use thread::Thread;
 
@@ -476,7 +477,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);
             });
@@ -496,7 +497,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()));
@@ -546,7 +547,7 @@ mod tests {
 
         Thread::spawn(move|| {
             drop(S1);
-        }).join();
+        }).join().ok().unwrap();
     }
 
     #[test]
@@ -564,7 +565,7 @@ mod tests {
 
         Thread::spawn(move|| unsafe {
             K1.with(|s| *s.get() = Some(S1));
-        }).join();
+        }).join().ok().unwrap();
     }
 
     #[test]
@@ -589,7 +590,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())));
         });
@@ -599,7 +600,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 5f96548c053..a2e2bd43849 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::*;
 
     scoped_thread_local!(static FOO: uint);