Skip to content

Commit 2ec0e85

Browse files
author
Jethro Beekman
committed
Print a slightly clearer message when failing to spawn a thread
1 parent 7001537 commit 2ec0e85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/thread/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl Builder {
607607
pub fn spawn<F, T>(f: F) -> JoinHandle<T> where
608608
F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
609609
{
610-
Builder::new().spawn(f).unwrap()
610+
Builder::new().spawn(f).expect("failed to spawn thread")
611611
}
612612

613613
/// Gets a handle to the thread that invokes it.

0 commit comments

Comments
 (0)