-
-
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
clippy::almost_swapped
check failing on latest nightly
#4733
Comments
clippy::correctness
check failing on latest nightlyclippy::almost_swapped
check failing on latest nightly
There is a similar error with subcommands: #[derive(clap::Subcommand)]
enum Command {
X
} results in:
The relevant part of the expansion seems to be: impl clap::Subcommand for Command {
fn augment_subcommands<'b>(__clap_app: clap::Command) -> clap::Command {
;
let __clap_app = __clap_app;
let __clap_app =
__clap_app.subcommand({
let __clap_subcommand = clap::Command::new("x");
let __clap_subcommand = __clap_subcommand;
let __clap_subcommand = __clap_subcommand;
__clap_subcommand
});
;
__clap_app
}
fn augment_subcommands_for_update<'b>(__clap_app: clap::Command)
-> clap::Command {
;
let __clap_app = __clap_app;
let __clap_app =
__clap_app.subcommand({
let __clap_subcommand = clap::Command::new("x");
let __clap_subcommand = __clap_subcommand;
let __clap_subcommand = __clap_subcommand;
__clap_subcommand
});
;
__clap_app
}
fn has_subcommand(__clap_name: &str) -> bool {
if "x" == __clap_name { return true }
false
}
} |
Due to clap-rs/clap#4733 one has to revert back to clippy 1.64 Signed-off-by: Didier Wenzek <[email protected]>
@epage seems like we need to reopen this, because |
Due to clap-rs/clap#4733 not fully fixed.
Made a clippy issue: rust-lang/rust-clippy#10421 Not clear to me that this should trigger clippy at all. At the very least the error message is wrong |
Seems unnecessary to have Macros aren't really where you want clippy to be at its strictest. And really shouldn't be having clippy to catch bugs in macro code from user usage.. |
Needed until clap-rs/clap#4733 is fixed. Signed-off-by: Andre Fredette <[email protected]>
## Motivation This bumps `clap` to the latest stable version. This probably good for it's own reasons, but the real motivation is fix the new clippy lints that dropped. clap-rs/clap#4733 ## Solution 1. Bump `clap` version. 2. Profit!!!
I've made a PR to Clippy, in a few days it should be fixed in Clippy itself (even without changing Clap's version). |
* Bump Rust version to 1.69 * Bump clap to fix clippy lints See: clap-rs/clap#4733
This avoids a lint failure <clap-rs/clap#4733>.
* 🐛 Fix up commit template path bug * 🧹 remove unused import * 🏭 Update shared action ref * 📋 Attempt to fix ci clippy * 🏭 skip clippy warning for now. clap-rs/clap#4733 (comment) * 📋 Try skip correctness as well * 🏭 Just skip clippy for now. * 🏭 Skip clippy for now * 📖 Add deprecated note.
This fixes a known issue introduced in rust 1.69 clippy that required additional changes to clap. See: rust-lang/rust-clippy#10421 clap-rs/clap#4733
This fixes a known issue introduced in rust 1.69 clippy that required additional changes to clap. See: rust-lang/rust-clippy#10421 clap-rs/clap#4733
Details can be seen in clap-rs/clap#4733. Using Subcommand with old clap versions causes clippy 1.69 to complain. In this case it was: ``` error: this looks like you are trying to swap `arg` and `cmd` --> src/bin/cog/main.rs:292:23 ```
Details can be seen in clap-rs/clap#4733. Using Subcommand with old clap versions causes clippy 1.69 to complain. In this case it was: ``` error: this looks like you are trying to swap `arg` and `cmd` --> src/bin/cog/main.rs:292:23 ```
This fixes clippy errors (see clap-rs/clap#4733)
* Migrate from tui-rs to ratatui * Update clap to version 4.1.14 This fixes clippy errors (see clap-rs/clap#4733)
This reverts commit 51e1028.
This reverts commit 51e1028.
Please complete the following tasks
Rust Version
rustc 1.69.0-nightly (d962ea578 2023-02-26)
Clap Version
4.1.4
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo clippy
Actual Behaviour
Expected Behaviour
No clippy errors
Additional Context
Debug Output
No response
The text was updated successfully, but these errors were encountered: