Skip to content

Commit cc9444d

Browse files
committed
Auto merge of #2841 - RalfJung:compiletest, r=oli-obk
compiletest: complain about unknown flags This would have avoided rust-lang/rust#110102
2 parents 510d727 + ac769bc commit cc9444d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/compiletest.rs

+12
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,24 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
100100
};
101101

102102
// Handle command-line arguments.
103+
let mut after_dashdash = false;
103104
config.path_filter.extend(std::env::args().skip(1).filter(|arg| {
105+
if after_dashdash {
106+
// Just propagate everything.
107+
return true;
108+
}
104109
match &**arg {
105110
"--quiet" => {
106111
config.quiet = true;
107112
false
108113
}
114+
"--" => {
115+
after_dashdash = true;
116+
false
117+
}
118+
s if s.starts_with('-') => {
119+
panic!("unknown compiletest flag `{s}`");
120+
}
109121
_ => true,
110122
}
111123
}));

0 commit comments

Comments
 (0)