From: Jethro Beekman Date: Tue, 22 Jan 2019 13:21:54 +0000 (+0530) Subject: Print a slightly clearer message when failing to spawn a thread X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=2ec0e85305e69d7f6e1bc0c704a6566ad38232a4;p=rust.git Print a slightly clearer message when failing to spawn a thread --- diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index a55b32c08a3..eb8e0c1c8ac 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -607,7 +607,7 @@ pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result> pub fn spawn(f: F) -> JoinHandle 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.