Skip to content

Commit d12b857

Browse files
committed
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.
2 parents 1f7fb64 + 52dd0b6 commit d12b857

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Diff for: src/test/ui/ptr_ops/issue-80309-safe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-pass
22
// min-llvm-version: 13.0
3-
// compiler-flags: -O
3+
// compile-flags: -O
44

55
// Regression test for issue #80309
66

Diff for: src/test/ui/ptr_ops/issue-80309.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-pass
22
// min-llvm-version: 13.0
3-
// compiler-flags: -O
3+
// compile-flags: -O
44

55
// Regression test for issue #80309
66

Diff for: src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compiler-flags: -Z parse-only
1+
// compile-flags: -Z parse-only
22

33
#![feature(const_trait_impl)]
44

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)