prevent configuring the edition with //@compile-flags

This commit is contained in:
Pietro Albini 2025-04-08 15:36:12 +02:00
parent cd3a7bb961
commit 2638e4e8b2
No known key found for this signature in database
GPG key ID: CD76B35F7734769E

View file

@ -378,7 +378,13 @@ impl TestProps {
}
if let Some(flags) = config.parse_name_value_directive(ln, COMPILE_FLAGS) {
self.compile_flags.extend(split_flags(&flags));
let flags = split_flags(&flags);
for flag in &flags {
if flag == "--edition" || flag.starts_with("--edition=") {
panic!("you must use `//@ edition` to configure the edition");
}
}
self.compile_flags.extend(flags);
}
if config.parse_name_value_directive(ln, INCORRECT_COMPILER_FLAGS).is_some() {
panic!("`compiler-flags` directive should be spelled `compile-flags`");