-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Some clap v3.x Subcommand derives cause clippy errors since Rust 1.69.0 #4857
Comments
I am fine with someone fixing this in v3-master. |
The `#[deny(correctness)]` attribute is inside some generated code (such as the `Subcommand` derive macro). As of Rust 1.69.0, this is triggering a clippy error in some uses. Due to the placement of the `deny`, it is not possible for a user of clap to override it. This change removes all the instances of this `deny` attribute. The same was done on the `master` branch in clap-rs#4739. Fixes: clap-rs#4857
The `#[deny(correctness)]` attribute is inside some generated code (such as the `Subcommand` derive macro). As of Rust 1.69.0, this is triggering a clippy error in some uses. Due to the placement of the `deny`, it is not possible for a user of clap to override it. This change removes all the instances of this `deny` attribute. The same was done on the `master` branch in clap-rs#4739. Fixes: clap-rs#4857
The `#[deny(correctness)]` attribute is inside some generated code (such as the `Subcommand` derive macro). As of Rust 1.69.0, this is triggering a clippy error in some uses. Due to the placement of the `deny`, it is not possible for a user of clap to override it. This change removes all the instances of this `deny` attribute. The same was done on the `master` branch in clap-rs#4739. Fixes: clap-rs#4857
@epage Can we I'm willing to make the pr to do this! |
I will say that the idea is to match clap v4. We should treat anything in v3 as backports. I should have looked more closely to confirm that. I would be open to a PR if it makes things more aligned with v4. If someone wants something that is not in v4, we should put it in v4 first. |
I would be fine with that |
Thanks for following up here @hds ! |
As of Rust 1.69, the `clippy::almost_swapped` lint was enhanced and now triggers on certain derive macros inside clap. To avoid the need for the user to allow these lints outside of the macro (which generally requires a module level `allow`), the allow was added to the generated code for the v4 branch in clap-rs#4735. This change backports that fix the the `v3-master` branch. Fixes: clap-rs#4857
I believe this is now resolved, so I'm going to close this. If there is something specific to this issue that still isn't resolved, let us know! |
Please complete the following tasks
Rust Version
rustc 1.69.0 (84c898d65 2023-04-16)
Clap Version
clap 3.2.23, clap_derive 3.2.18
Minimal reproducible code
Steps to reproduce the bug with the above code
Run clippy with defaults:
Actual Behaviour
This results in the following error in clippy.
Expected Behaviour
The clippy error is problematic because the attribute that specifies
deny
is inside the macro itself. That means that as a user of Clap, I'm not able to override the deny.Specifically this attribute:
#[deny(clippy::correctness)]
Which is present in 7 specific places in
clap_derive
.Additional Context
For Clap v4.x, these attributes were already removed in #4739.
Doing the same in the
v3-master
branch is probably sufficientDebug Output
No response
The text was updated successfully, but these errors were encountered: