From ad430f541cdef6925f7c9a9705d9fa9b6a219334 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 21 Feb 2022 17:53:16 -0800 Subject: [PATCH 1/2] rename compiler-flags to compile-flags --- src/test/ui/ptr_ops/issue-80309-safe.rs | 2 +- src/test/ui/ptr_ops/issue-80309.rs | 2 +- src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/ui/ptr_ops/issue-80309-safe.rs b/src/test/ui/ptr_ops/issue-80309-safe.rs index ca3778aab2da3..f7513b6b8f447 100644 --- a/src/test/ui/ptr_ops/issue-80309-safe.rs +++ b/src/test/ui/ptr_ops/issue-80309-safe.rs @@ -1,6 +1,6 @@ // run-pass // min-llvm-version: 13.0 -// compiler-flags: -O +// compile-flags: -O // Regression test for issue #80309 diff --git a/src/test/ui/ptr_ops/issue-80309.rs b/src/test/ui/ptr_ops/issue-80309.rs index bbec1012082c3..5c0f4b76ceb3a 100644 --- a/src/test/ui/ptr_ops/issue-80309.rs +++ b/src/test/ui/ptr_ops/issue-80309.rs @@ -1,6 +1,6 @@ // run-pass // min-llvm-version: 13.0 -// compiler-flags: -O +// compile-flags: -O // Regression test for issue #80309 diff --git a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs index 96ba393bd8594..e8b261545499f 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs +++ b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs @@ -1,4 +1,4 @@ -// compiler-flags: -Z parse-only +// compile-flags: -Z parse-only #![feature(const_trait_impl)] From 52dd0b6801c571bd9c294fe37436cd1a80b4da80 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 21 Feb 2022 17:53:31 -0800 Subject: [PATCH 2/2] reject compiler-flags as a compiletest attribute --- src/tools/compiletest/src/header.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 887d27fd6dca4..d39497a2c42c8 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -189,6 +189,8 @@ mod directives { pub const STDERR_PER_BITWIDTH: &'static str = "stderr-per-bitwidth"; pub const INCREMENTAL: &'static str = "incremental"; pub const KNOWN_BUG: &'static str = "known-bug"; + // This isn't a real directive, just one that is probably mistyped often + pub const INCORRECT_COMPILER_FLAGS: &'static str = "compiler-flags"; } impl TestProps { @@ -282,6 +284,9 @@ impl TestProps { if let Some(flags) = config.parse_name_value_directive(ln, COMPILE_FLAGS) { self.compile_flags.extend(flags.split_whitespace().map(|s| s.to_owned())); } + if config.parse_name_value_directive(ln, INCORRECT_COMPILER_FLAGS).is_some() { + panic!("`compiler-flags` directive should be spelled `compile-flags`"); + } if let Some(edition) = config.parse_edition(ln) { self.compile_flags.push(format!("--edition={}", edition));