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:
Eric Huss 2025-02-12 14:12:16 -08:00
parent c1791a1b48
commit 7dc9e05742

View File

@ -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 {