]> git.lizzy.rs Git - rust.git/commitdiff
Print a slightly clearer message when failing to spawn a thread
authorJethro Beekman <jethro@fortanix.com>
Tue, 22 Jan 2019 13:21:54 +0000 (18:51 +0530)
committerJethro Beekman <jethro@fortanix.com>
Tue, 22 Jan 2019 13:25:12 +0000 (18:55 +0530)
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.