diff options
| author | bors <bors@rust-lang.org> | 2017-10-10 08:30:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-10-10 08:30:10 +0000 |
| commit | 5f578dfad0dd5d43b28eff71a7e857d10c3f55fe (patch) | |
| tree | 3be1199fa3bc4458aea4e7c083241db51dd11aca /src/libstd/thread | |
| parent | 13ae187043a73a07bc15f5856d1a8f7a737f244d (diff) | |
| parent | 6a7785330a664adae535b29bfdc7c79012fca6bb (diff) | |
| download | rust-5f578dfad0dd5d43b28eff71a7e857d10c3f55fe.tar.gz rust-5f578dfad0dd5d43b28eff71a7e857d10c3f55fe.zip | |
Auto merge of #45141 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests - Successful merges: #44962, #45051, #45091, #45106, #45117, #45118, #45120, #45125, #45136 - Failed merges:
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 30887b16c60..07bbddc62b9 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -485,15 +485,17 @@ impl Builder { /// let (tx, rx) = channel(); /// /// let sender = thread::spawn(move || { -/// let _ = tx.send("Hello, thread".to_owned()); +/// tx.send("Hello, thread".to_owned()) +/// .expect("Unable to send on channel"); /// }); /// /// let receiver = thread::spawn(move || { -/// println!("{}", rx.recv().unwrap()); +/// let value = rx.recv().expect("Unable to receive from channel"); +/// println!("{}", value); /// }); /// -/// let _ = sender.join(); -/// let _ = receiver.join(); +/// sender.join().expect("The sender thread has panicked"); +/// receiver.join().expect("The receiver thread has panicked"); /// ``` /// /// A thread can also return a value through its [`JoinHandle`], you can use @@ -1192,7 +1194,7 @@ impl<T> JoinInner<T> { /// }); /// }); /// -/// let _ = original_thread.join(); +/// original_thread.join().expect("The thread being joined has panicked"); /// println!("Original thread is joined."); /// /// // We make sure that the new thread has time to run, before the main |
