Do not allow JSON targets to set is-builtin: true
This commit is contained in:
parent
6440785304
commit
f4701cd65c
5 changed files with 19 additions and 1 deletions
|
@ -2010,6 +2010,10 @@ impl Target {
|
|||
key!(supported_sanitizers, SanitizerSet)?;
|
||||
key!(default_adjusted_cabi, Option<Abi>)?;
|
||||
|
||||
if base.is_builtin {
|
||||
// This can cause unfortunate ICEs later down the line.
|
||||
return Err(format!("may not set is_builtin for targets not built-in"));
|
||||
}
|
||||
// Each field should have been read using `Json::remove_key` so any keys remaining are unused.
|
||||
let remaining_keys = obj.as_object().ok_or("Expected JSON object for target")?.keys();
|
||||
Ok((
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue