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
Summary
panic_in_result_fnfires onpanic!,unimplemented!,todo!, andunreachable!.panic,unimplemented, andunreachableall make since since they represent "final" code. Linting ontodo!doesn't really make sense in this group however, since it usually represents a work in progress - firing ontodo!()code is just noisy.Lint Name
panic_in_result_fn
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No lint
Version
Additional Labels
No response