Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s/compiler-flags/compile-flags in compiletest #94243

Merged
merged 2 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/test/ui/ptr_ops/issue-80309-safe.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-pass
// min-llvm-version: 13.0
// compiler-flags: -O
// compile-flags: -O

// Regression test for issue #80309

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/ptr_ops/issue-80309.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-pass
// min-llvm-version: 13.0
// compiler-flags: -O
// compile-flags: -O

// Regression test for issue #80309

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compiler-flags: -Z parse-only
// compile-flags: -Z parse-only

#![feature(const_trait_impl)]

Expand Down
5 changes: 5 additions & 0 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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));
Expand Down