about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-11 00:58:22 +0000
committerbors <bors@rust-lang.org>2022-04-11 00:58:22 +0000
commitd12b8578163ac67e5d088550920f7cafd435f52b (patch)
tree3ba6c3893a356c2bca32a39046ae613539d5a270
parent1f7fb6413d6d6c0c929b223e478e44c3db991b03 (diff)
parent52dd0b6801c571bd9c294fe37436cd1a80b4da80 (diff)
downloadrust-d12b8578163ac67e5d088550920f7cafd435f52b.tar.gz
rust-d12b8578163ac67e5d088550920f7cafd435f52b.zip
Auto merge of #94243 - compiler-errors:compiler-flags-typo, r=Mark-Simulacrum
`s/compiler-flags/compile-flags` in compiletest

Also make compiletest panic so this doesn't happen in the future! I literally always forget which it's called, so I wanted to make my life easier in the future.

Also open to the possibility of parsing both.
-rw-r--r--src/test/ui/ptr_ops/issue-80309-safe.rs2
-rw-r--r--src/test/ui/ptr_ops/issue-80309.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs2
-rw-r--r--src/tools/compiletest/src/header.rs5
4 files changed, 8 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 ca3778aab2d..f7513b6b8f4 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 bbec1012082..5c0f4b76ceb 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 96ba393bd85..e8b26154549 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)]
 
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 8a72b44e2b5..858a576dcb4 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));