-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
New stack macro implementation triggers clippy::toplevel_ref_arg warning #1422
Comments
Uhm, does |
It seems so: rust-lang/rust-clippy#702. I don't understand why that decision was made. |
This comment suggests that it's due to our use of spans in the I'm not sure off the top of my head if we can put these attributes on code blocks though (not a function/impl block). |
I would absolutely not do that. That will suppress all future clippy lints, some of which might be useful. i think the (reasonable) options are:
I'm not even sure how option 3. would work to be honest. |
@danieleades: appreciate your input. However, in my 8 years of working with Rust, I've never seen clippy actually point out a real problem or bug, but I've seen plenty of energy and time spent by maintainers and contributors fixing clippy complaints. I don't consider it likely that clippy will uncover an actual bug in the future inside this generated code. I personally find it a better trade-off to just ignore clippy entirely within the generated code, so we don't land back into the same situation if/when clippy gets a new lint that the generated code may trigger. |
I absolutely have. Though generally related to (ab)use of static items, synchronisation primitives, etc. There's nothing like that in this code so I definitely take your point
yep. I had a look at the code for |
This line triggers the
clippy::toplevel_ref_arg
warning for users ofstack!
.Example warning:
The text was updated successfully, but these errors were encountered: