Skip to content

Commit 52dd0b6

Browse files
reject compiler-flags as a compiletest attribute
1 parent ad430f5 commit 52dd0b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/tools/compiletest/src/header.rs

+5
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ mod directives {
189189
pub const STDERR_PER_BITWIDTH: &'static str = "stderr-per-bitwidth";
190190
pub const INCREMENTAL: &'static str = "incremental";
191191
pub const KNOWN_BUG: &'static str = "known-bug";
192+
// This isn't a real directive, just one that is probably mistyped often
193+
pub const INCORRECT_COMPILER_FLAGS: &'static str = "compiler-flags";
192194
}
193195

194196
impl TestProps {
@@ -282,6 +284,9 @@ impl TestProps {
282284
if let Some(flags) = config.parse_name_value_directive(ln, COMPILE_FLAGS) {
283285
self.compile_flags.extend(flags.split_whitespace().map(|s| s.to_owned()));
284286
}
287+
if config.parse_name_value_directive(ln, INCORRECT_COMPILER_FLAGS).is_some() {
288+
panic!("`compiler-flags` directive should be spelled `compile-flags`");
289+
}
285290

286291
if let Some(edition) = config.parse_edition(ln) {
287292
self.compile_flags.push(format!("--edition={}", edition));

0 commit comments

Comments
 (0)