-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fake return edge triggers clippy::panic_in_result_fn
lint for functions returning Result
#2498
Comments
Hmm, it's surprising that adding an If we can't |
With the Rust 1.73 clippy update, the I've confirmed that this issue no longer occurs on Rust 1.73 on our codebase, will be closing this issue as completed. |
Bug Report
Version
(Version number from Rust playground as of creating this issue)
tracing-attributes
:0.1.23
Platform
I've noticed this on both Linux (CI builds) and MacOS (development machines).
Crates
tracing-attributes
:0.1.23
Description
Sample code: (Rust playground)
The fake return edge added in #2270 triggers the
clippy::panic_in_result_fn
lint for the above sample code (and async functions which returnResult
). The only way of ignoring the lint is to annotate the entire function with#[allow(clippy::panic_in_result_fn)]
, which I'd like to avoid as it allows calling panicking code elsewhere in the function.I tried to allow the lint only for the fake return edge block on a fork of
tracing
but didn't succeed. Let me know if I should open an issue on the clippy repository for ignoring this lint on macro generated code (this might also be related to rust-lang/rust-clippy#407 in that case).I'd be happy to open a PR to fix this, I'm just not sure how this can be solved though, and whether a change must be made in
tracing-attributes
or in the clippy codebase.The text was updated successfully, but these errors were encountered: