diff options
| author | Ralf Jung <post@ralfj.de> | 2023-04-13 11:38:40 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-04-13 11:38:40 +0200 |
| commit | 69b023f93bf77c6b25099a45392f7b293a4d3dde (patch) | |
| tree | ce31b66f9ff5d1e877f88d2e9418bdabec3a849b | |
| parent | 7315b6da628e0e6759c2eab5e83253edc1f1f9a7 (diff) | |
| download | rust-69b023f93bf77c6b25099a45392f7b293a4d3dde.tar.gz rust-69b023f93bf77c6b25099a45392f7b293a4d3dde.zip | |
compiletest: complain about unknown flags
| -rw-r--r-- | src/tools/miri/tests/compiletest.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/miri/tests/compiletest.rs b/src/tools/miri/tests/compiletest.rs index 21eaeabe6ad..355f6f95310 100644 --- a/src/tools/miri/tests/compiletest.rs +++ b/src/tools/miri/tests/compiletest.rs @@ -100,12 +100,24 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R }; // Handle command-line arguments. + let mut after_dashdash = false; config.path_filter.extend(std::env::args().skip(1).filter(|arg| { + if after_dashdash { + // Just propagate everything. + return true; + } match &**arg { "--quiet" => { config.quiet = true; false } + "--" => { + after_dashdash = true; + false + } + s if s.starts_with('-') => { + panic!("unknown compiletest flag `{s}`"); + } _ => true, } })); |
