-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Closed
Copy link
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't havegood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
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
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't havegood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy