diff options
| author | bors <bors@rust-lang.org> | 2021-07-02 02:56:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-02 02:56:45 +0000 |
| commit | 7cd0643eb223bbc4236ca1852cb163ce77b4ffc1 (patch) | |
| tree | a16ca8cf67dda5eceb08eb34ee737d62b188906c /src | |
| parent | 59cf7e3882d57487ce9aa983489712bf4b4af192 (diff) | |
| parent | ebe52869a344ca11263934c208dc18412acd794b (diff) | |
| download | rust-7cd0643eb223bbc4236ca1852cb163ce77b4ffc1.tar.gz rust-7cd0643eb223bbc4236ca1852cb163ce77b4ffc1.zip | |
Auto merge of #86782 - flip1995:clippyup, r=Manishearth
Update Clippy Biweekly Clippy Update r? `@Manishearth`
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/main.rs b/src/main.rs index 7bb80b1196e..6bd4123ddeb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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() { @@ -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()); @@ -176,34 +169,23 @@ mod tests { use super::ClippyCmd; #[test] - #[should_panic] - fn fix_without_unstable() { + fn fix() { let args = "cargo clippy --fix".split_whitespace().map(ToString::to_string); - ClippyCmd::new(args); - } - - #[test] - fn fix_unstable() { - let args = "cargo clippy --fix -Zunstable-options" - .split_whitespace() - .map(ToString::to_string); let cmd = ClippyCmd::new(args); assert_eq!("fix", cmd.cargo_subcommand); - assert!(cmd.args.iter().any(|arg| arg.ends_with("unstable-options"))); + assert!(!cmd.args.iter().any(|arg| arg.ends_with("unstable-options"))); } #[test] fn fix_implies_no_deps() { - let args = "cargo clippy --fix -Zunstable-options" - .split_whitespace() - .map(ToString::to_string); + let args = "cargo clippy --fix".split_whitespace().map(ToString::to_string); let cmd = ClippyCmd::new(args); assert!(cmd.clippy_args.iter().any(|arg| arg == "--no-deps")); } #[test] fn no_deps_not_duplicated_with_fix() { - let args = "cargo clippy --fix -Zunstable-options -- --no-deps" + let args = "cargo clippy --fix -- --no-deps" .split_whitespace() .map(ToString::to_string); let cmd = ClippyCmd::new(args); |
