]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/thread/mod.rs
Print a slightly clearer message when failing to spawn a thread
[rust.git] / src / libstd / thread / mod.rs
index a55b32c08a303b55b42a48c7b49939e69cdeaf5b..eb8e0c1c8ac66777d1b774b67c90d101b41fdeba 100644 (file)
@@ -607,7 +607,7 @@ pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result<JoinHandle<T>>
 pub fn spawn<F, T>(f: F) -> JoinHandle<T> where
     F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
 {
-    Builder::new().spawn(f).unwrap()
+    Builder::new().spawn(f).expect("failed to spawn thread")
 }
 
 /// Gets a handle to the thread that invokes it.