|
if let Some(ref backends) = codegen_backends { |
|
let available_backends = ["llvm", "cranelift", "gcc"]; |
|
|
|
self.rust_codegen_backends = backends.iter().map(|s| { |
|
if let Some(backend) = s.strip_prefix(CODEGEN_BACKEND_PREFIX) { |
|
if available_backends.contains(&backend) { |
|
panic!("Invalid value '{s}' for 'rust.codegen-backends'. Instead, please use '{backend}'."); |
|
} else { |
|
println!("HELP: '{s}' for 'rust.codegen-backends' might fail. \ |
|
Codegen backends are mostly defined without the '{CODEGEN_BACKEND_PREFIX}' prefix. \ |
|
In this case, it would be referred to as '{backend}'."); |
|
} |
|
} |
|
|
|
s.clone() |
|
}).collect(); |
|
} |
If the value does not start with CODEGEN_BACKEND_PREFIX, it is just not validated at all.
So it means that typing gccc instead of gcc will cause no warning or error to be shown and gcc backend not actually being enabled.
Same issue for target-specific codegen options.
rust/src/bootstrap/src/core/config/toml/rust.rs
Lines 576 to 592 in 2f2c8c3
If the value does not start with CODEGEN_BACKEND_PREFIX, it is just not validated at all.
So it means that typing
gcccinstead ofgccwill cause no warning or error to be shown andgccbackend not actually being enabled.Same issue for target-specific codegen options.