Skip to content

Commit 92bdbd6

Browse files
ehussgitbot
authored and
gitbot
committed
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 `!`.
1 parent 552997a commit 92bdbd6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

std/src/panic.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
376376
/// use std::panic;
377377
///
378378
/// let result = panic::catch_unwind(|| {
379-
/// panic!("oh no!");
379+
/// if 1 != 2 {
380+
/// panic!("oh no!");
381+
/// }
380382
/// });
381383
///
382384
/// if let Err(err) = result {

0 commit comments

Comments
 (0)