mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
std: Apply dependency_on_unit_never_type_fallback
This generates a warning of irrefutable patterns. I decided to slightly tweak the example so the closure returns unit, since the intent wasn't to show the weird behavior of returning `!`.
This commit is contained in:
parent
c1791a1b48
commit
7dc9e05742
@ -376,7 +376,9 @@ pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
|
||||
/// use std::panic;
|
||||
///
|
||||
/// let result = panic::catch_unwind(|| {
|
||||
/// panic!("oh no!");
|
||||
/// if 1 != 2 {
|
||||
/// panic!("oh no!");
|
||||
/// }
|
||||
/// });
|
||||
///
|
||||
/// if let Err(err) = result {
|
||||
|
Loading…
Reference in New Issue
Block a user