Skip to content

Commit 2638e4e

Browse files
committed
prevent configuring the edition with //@compile-flags
1 parent cd3a7bb commit 2638e4e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,13 @@ impl TestProps {
378378
}
379379

380380
if let Some(flags) = config.parse_name_value_directive(ln, COMPILE_FLAGS) {
381-
self.compile_flags.extend(split_flags(&flags));
381+
let flags = split_flags(&flags);
382+
for flag in &flags {
383+
if flag == "--edition" || flag.starts_with("--edition=") {
384+
panic!("you must use `//@ edition` to configure the edition");
385+
}
386+
}
387+
self.compile_flags.extend(flags);
382388
}
383389
if config.parse_name_value_directive(ln, INCORRECT_COMPILER_FLAGS).is_some() {
384390
panic!("`compiler-flags` directive should be spelled `compile-flags`");

0 commit comments

Comments
 (0)