]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/thread.rs
Thread native name setting, fix #10302
[rust.git] / src / libstd / thread.rs
index c103365745cd612207f2112322a3c21f9c70b0f7..a86b82b8c62ec210817f71c2d8f6620d76915b13 100644 (file)
@@ -207,14 +207,14 @@ pub fn stack_size(mut self, size: uint) -> Builder {
     }
 
     /// Redirect thread-local stdout.
-    #[experimental = "Will likely go away after proc removal"]
+    #[unstable = "Will likely go away after proc removal"]
     pub fn stdout(mut self, stdout: Box<Writer + Send>) -> Builder {
         self.stdout = Some(stdout);
         self
     }
 
     /// Redirect thread-local stderr.
-    #[experimental = "Will likely go away after proc removal"]
+    #[unstable = "Will likely go away after proc removal"]
     pub fn stderr(mut self, stderr: Box<Writer + Send>) -> Builder {
         self.stderr = Some(stderr);
         self
@@ -382,7 +382,7 @@ pub fn yield_now() {
         unsafe { imp::yield_now() }
     }
 
-    /// Determines whether the current thread is panicking.
+    /// Determines whether the current thread is unwinding because of panic.
     #[inline]
     #[stable]
     pub fn panicking() -> bool {
@@ -483,7 +483,7 @@ pub fn join(mut self) -> Result<T> {
 
 impl<T: Send> JoinGuard<'static, T> {
     /// Detaches the child thread, allowing it to outlive its parent.
-    #[experimental = "unsure whether this API imposes limitations elsewhere"]
+    #[unstable = "unsure whether this API imposes limitations elsewhere"]
     pub fn detach(mut self) {
         unsafe { imp::detach(self.native) };
         self.joined = true; // avoid joining in the destructor
@@ -519,14 +519,14 @@ mod test {
     fn test_unnamed_thread() {
         Thread::scoped(move|| {
             assert!(Thread::current().name().is_none());
-        }).join().map_err(|_| ()).unwrap();
+        }).join().ok().unwrap();
     }
 
     #[test]
     fn test_named_thread() {
         Builder::new().name("ada lovelace".to_string()).scoped(move|| {
             assert!(Thread::current().name().unwrap() == "ada lovelace".to_string());
-        }).join().map_err(|_| ()).unwrap();
+        }).join().ok().unwrap();
     }
 
     #[test]
@@ -662,7 +662,7 @@ fn test_try_panic_message_static_str() {
             Err(e) => {
                 type T = &'static str;
                 assert!(e.is::<T>());
-                assert_eq!(*e.downcast::<T>().unwrap(), "static string");
+                assert_eq!(*e.downcast::<T>().ok().unwrap(), "static string");
             }
             Ok(()) => panic!()
         }
@@ -676,7 +676,7 @@ fn test_try_panic_message_owned_str() {
             Err(e) => {
                 type T = String;
                 assert!(e.is::<T>());
-                assert_eq!(*e.downcast::<T>().unwrap(), "owned string".to_string());
+                assert_eq!(*e.downcast::<T>().ok().unwrap(), "owned string".to_string());
             }
             Ok(()) => panic!()
         }
@@ -690,9 +690,9 @@ fn test_try_panic_message_any() {
             Err(e) => {
                 type T = Box<Any + Send>;
                 assert!(e.is::<T>());
-                let any = e.downcast::<T>().unwrap();
+                let any = e.downcast::<T>().ok().unwrap();
                 assert!(any.is::<u16>());
-                assert_eq!(*any.downcast::<u16>().unwrap(), 413u16);
+                assert_eq!(*any.downcast::<u16>().ok().unwrap(), 413u16);
             }
             Ok(()) => panic!()
         }