about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-02-21 17:53:31 -0800
committerMichael Goulet <michael@errs.io>2022-02-21 17:58:26 -0800
commit52dd0b6801c571bd9c294fe37436cd1a80b4da80 (patch)
tree74cc86d11087ca82f15b49052c4ede9c69601eea
parentad430f541cdef6925f7c9a9705d9fa9b6a219334 (diff)
downloadrust-52dd0b6801c571bd9c294fe37436cd1a80b4da80.tar.gz
rust-52dd0b6801c571bd9c294fe37436cd1a80b4da80.zip
reject compiler-flags as a compiletest attribute
-rw-r--r--src/tools/compiletest/src/header.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 887d27fd6dc..d39497a2c42 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));