Closed
Description
Summary
panic_in_result_fn
fires on panic!
, unimplemented!
, todo!
, and unreachable!
. panic
,unimplemented
, and unreachable
all make since since they represent "final" code. Linting on todo!
doesn't really make sense in this group however, since it usually represents a work in progress - firing on todo!()
code is just noisy.
Lint Name
panic_in_result_fn
Reproducer
I tried this code:
#![warn(clippy::panic_in_result_fn)]
fn foo() -> Result<(), ()> { todo!() }
I saw this happen:
[<output>](warning: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`)
...
I expected to see this happen:
No lint
Version
rustc 1.72.0-nightly (871b59520 2023-05-31)
Additional Labels
No response