-
Notifications
You must be signed in to change notification settings - Fork 725
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
Clippy cognitive complexity false positive #553
Comments
Tracing library at some times causes Clippy to emit a cognitive complexity warning. Issue raised on the tokio-rs/tracing repo tokio-rs/tracing#553 Add Clippy attributes to allow cognitive complexity where needed.
Yeah, this has been brought up in the past. Apparently this lint is run after macro expansion, rather than before, so the code generated by Unfortunately, my understanding is that there isn't really anything we can do to fix this in At one point, I thought the |
cc @yaahc |
It looks like they were about to but then the issue got sidelined half a year ago and never got pushed across the finish line. I'll ping them and see where its at and if they're planning on working on it soon or if it would be possible for me to take over once I've finished with the cargo clippy --fix stuff. |
Thanks for taking a look! It would be great if this could be fixed upstream. |
Closing this, as it's an upstream problem we can't really solve. |
2519: Fix comment typo - no trippers around here please r=mergify[bot] a=tcharding Fix amusing comment typo ``` -// tracing trippers clippy warning, issue reported: tokio-rs/tracing#553 +// tracing triggers clippy warning, issue reported: tokio-rs/tracing#553 ``` Co-authored-by: Tobin C. Harding <tobin.harding@coblox.tech>
Bug Report
Version
tracing = "0.1"
cargo 1.40.0 (bc8e4c8be 2019-11-22)
clippy 0.0.212 (c8e3cfb 2019-10-28)
Platform
Linux ares 5.4.14-050414-generic #202001230832 SMP Thu Jan 23 08:34:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Description
When using
tracing
library to create an event in the match arms of an enum with six or more variants the Clippy 'cognitive complexity' warning is triggered.Here is a minimal reproducer
And Clippy gives the following warning:
Removing the final variant (
Choke
) removes the warning.The text was updated successfully, but these errors were encountered: