Skip to content

Rollup of 15 pull requests #81002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 46 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
64f11b9
Update tests of "unused_lifetimes" lint for async functions and corre…
Dec 4, 2020
3ea744e
Recommend panic::resume_unwind instead of panicking.
frewsxcv Dec 18, 2020
1f9a8a1
Add a `std::io::read_to_string` function
camelid Nov 5, 2020
4ee6d1b
Add description independent of `Read::read_to_string`
camelid Dec 30, 2020
588786a
Add error docs
camelid Dec 30, 2020
a398106
Remove unreachable panics from VecDeque
bugadani Jan 9, 2021
7463292
Add docs on performance
camelid Jan 12, 2021
c3f7429
Use better ICE message when no MIR is available
camelid Jan 13, 2021
7e83fec
remove unstable deprecated Vec::remove_item
KodrAus Jan 13, 2021
6bfd987
Update books
ehuss Jan 13, 2021
d65cb6e
deprecate atomic::spin_loop_hint in favour of hint::spin_loop
KodrAus Jan 13, 2021
697b20f
Fixed incorrect doc comment
trevarj Jan 13, 2021
52adfdd
Use Option::map_or instead of `.map(..).unwrap_or(..)`
LingMan Jan 11, 2021
64c1b0d
Fix -Cpasses=list and llvm version print with -vV
bjorn3 Jan 13, 2021
5b1316f
unix ExitStatus: Do not treat WIFSTOPPED as WIFSIGNALED
ijackson Dec 12, 2020
12d62aa
unix ExitStatus: Clarify docs for .signal()
ijackson Dec 12, 2020
530270f
unix ExitStatus: Provide .into_raw()
ijackson Dec 12, 2020
3f05051
unix ExitStatus: Provide .core_dumped
ijackson Dec 12, 2020
f060b9e
unix ExitStatus: Provide .stopped_signal()
ijackson Dec 12, 2020
42ea8f6
unix ExitStatus: Provide .continued()
ijackson Dec 12, 2020
29c851a
Replace `Ie` with `In other words`
ijackson Dec 13, 2020
06a405c
Replace `Ie` with `In other words`
ijackson Dec 13, 2020
fa68567
unix ExitStatus: Add tracking issue to new methods
ijackson Jan 4, 2021
7012194
ExitStatusExt unix: Retrospectively seal this trait
ijackson Jan 4, 2021
f3e7199
ExitStatusExt windows: Retrospectively seal this trait
ijackson Jan 4, 2021
efddf59
Fix typo saeled -> sealed
dtolnay Jan 11, 2021
05a88aa
ExitStatusExt: Fix build on Fuchsia
ijackson Jan 13, 2021
b59fa3d
Fix stabilisation version of slice_strip
ijackson Jan 13, 2021
0342fd1
Remove the unused context from CreateDebugLocation
cuviper Jan 13, 2021
eb72dc5
Add as_ref and as_mut methods for Bound
glittershark Dec 28, 2020
a8d0161
Fix typos in Fuchsia unix_process_wait_more
dtolnay Jan 14, 2021
ee6ff66
Rollup merge of #79689 - Vooblin:patch1, r=tmandry
JohnTitor Jan 14, 2021
07e7089
Rollup merge of #79982 - ijackson:exit-status, r=dtolnay
JohnTitor Jan 14, 2021
dba82da
Rollup merge of #80169 - frewsxcv:frewsxcv-docs-fix, r=jyn514
JohnTitor Jan 14, 2021
97466c6
Rollup merge of #80217 - camelid:io-read_to_string, r=m-ou-se
JohnTitor Jan 14, 2021
4204450
Rollup merge of #80444 - glittershark:bound-as-ref, r=dtolnay
JohnTitor Jan 14, 2021
54b27f9
Rollup merge of #80834 - bugadani:vecdeque, r=oli-obk
JohnTitor Jan 14, 2021
f8ede5d
Rollup merge of #80944 - LingMan:map_or, r=nagisa
JohnTitor Jan 14, 2021
17bfa9c
Rollup merge of #80966 - KodrAus:deprecate/spin_loop_hint, r=m-ou-se
JohnTitor Jan 14, 2021
ffa87ca
Rollup merge of #80969 - camelid:monomorph-ice-msg, r=nagisa
JohnTitor Jan 14, 2021
ab0aa0a
Rollup merge of #80972 - KodrAus:deprecate/remove_item, r=nagisa
JohnTitor Jan 14, 2021
d9e41b7
Rollup merge of #80973 - ehuss:update-books, r=ehuss
JohnTitor Jan 14, 2021
908ead5
Rollup merge of #80980 - trevarj:patch-1, r=nagisa
JohnTitor Jan 14, 2021
30ec4de
Rollup merge of #80981 - bjorn3:bjorn3-patch-1, r=jonas-schievink
JohnTitor Jan 14, 2021
8278100
Rollup merge of #80985 - ijackson:slice-strip-fix, r=jyn514
JohnTitor Jan 14, 2021
14d78d8
Rollup merge of #80990 - cuviper:unused-debug-context, r=nagisa
JohnTitor Jan 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
@@ -1186,32 +1186,37 @@ impl fmt::Debug for Thread {
/// the [`Error`](crate::error::Error) trait.
///
/// Thus, a sensible way to handle a thread panic is to either:
/// 1. `unwrap` the `Result<T>`, propagating the panic
///
/// 1. propagate the panic with [`std::panic::resume_unwind`]
/// 2. or in case the thread is intended to be a subsystem boundary
/// that is supposed to isolate system-level failures,
/// match on the `Err` variant and handle the panic in an appropriate way.
/// match on the `Err` variant and handle the panic in an appropriate way
///
/// A thread that completes without panicking is considered to exit successfully.
///
/// # Examples
///
/// Matching on the result of a joined thread:
///
/// ```no_run
/// use std::thread;
/// use std::fs;
/// use std::{fs, thread, panic};
///
/// fn copy_in_thread() -> thread::Result<()> {
/// thread::spawn(move || { fs::copy("foo.txt", "bar.txt").unwrap(); }).join()
/// thread::spawn(|| {
/// fs::copy("foo.txt", "bar.txt").unwrap();
/// }).join()
/// }
///
/// fn main() {
/// match copy_in_thread() {
/// Ok(_) => println!("this is fine"),
/// Err(_) => println!("thread panicked"),
/// Ok(_) => println!("copy succeeded"),
/// Err(e) => panic::resume_unwind(e),
/// }
/// }
/// ```
///
/// [`Result`]: crate::result::Result
/// [`std::panic::resume_unwind`]: crate::panic::resume_unwind
#[stable(feature = "rust1", since = "1.0.0")]
pub type Result<T> = crate::result::Result<T, Box<dyn Any + Send + 'static>>;