Skip to content

Commit

Permalink
Stabilize cargo clippy --fix
Browse files Browse the repository at this point in the history
This has been unstable since it was first introduced in
rust-lang#5363. In that time, I have
been using it successfully in nightly without issues. I don't think
there are any blocking issues now that RUSTC_WORKSPACE_WRAPPER is
stabilized, so this can be stabilized.
  • Loading branch information
jyn514 committed Jun 26, 2021
1 parent 8d427b6 commit 397aea7
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ impl ClippyCmd {
I: Iterator<Item = String>,
{
let mut cargo_subcommand = "check";
let mut unstable_options = false;
let mut args = vec![];

for arg in old_args.by_ref() {
Expand All @@ -80,18 +79,12 @@ impl ClippyCmd {
continue;
},
"--" => break,
// Cover -Zunstable-options and -Z unstable-options
s if s.ends_with("unstable-options") => unstable_options = true,
_ => {},
}

args.push(arg);
}

if cargo_subcommand == "fix" && !unstable_options {
panic!("Usage of `--fix` requires `-Z unstable-options`");
}

let mut clippy_args: Vec<String> = old_args.collect();
if cargo_subcommand == "fix" && !clippy_args.iter().any(|arg| arg == "--no-deps") {
clippy_args.push("--no-deps".into());
Expand Down

0 comments on commit 397aea7

Please sign in to comment.