From 69b023f93bf77c6b25099a45392f7b293a4d3dde Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 13 Apr 2023 11:38:40 +0200 Subject: [PATCH] compiletest: complain about unknown flags --- src/tools/miri/tests/compiletest.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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, } }));