mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
check for unstable options
This commit is contained in:
parent
7c479fd8a7
commit
df2d3c82df
30
src/main.rs
30
src/main.rs
@ -58,18 +58,36 @@ where
|
||||
{
|
||||
let mut args = vec!["check".to_owned()];
|
||||
|
||||
let mut fix = false;
|
||||
let mut unstable_options = false;
|
||||
|
||||
for arg in old_args.by_ref() {
|
||||
if arg == "--fix" {
|
||||
args[0] = "fix".to_owned();
|
||||
continue;
|
||||
match arg {
|
||||
"--fix" => {
|
||||
fix = true;
|
||||
continue;
|
||||
},
|
||||
"--" => break,
|
||||
// Cover -Zunstable-options and -Z unstable-options
|
||||
s if s.ends_with("unstable-options") => unstable_options = true,
|
||||
_ => {},
|
||||
}
|
||||
|
||||
if arg == "--" {
|
||||
break;
|
||||
}
|
||||
args.push(arg);
|
||||
}
|
||||
|
||||
if fix && !unstable_options {
|
||||
panic!("Usage of `--fix` requires `-Z unstable-options`");
|
||||
} else {
|
||||
args[0] = "fix".to_owned();
|
||||
}
|
||||
|
||||
let env_name = if unstable_options {
|
||||
"RUSTC_WORKSPACE_WRAPPER"
|
||||
} else {
|
||||
"RUSTC_WRAPPER"
|
||||
};
|
||||
|
||||
let clippy_args: String = old_args.map(|arg| format!("{}__CLIPPY_HACKERY__", arg)).collect();
|
||||
|
||||
let mut path = std::env::current_exe()
|
||||
|
Loading…
Reference in New Issue
Block a user