diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs index 134405f3630e7..4b6de5e18f50f 100644 --- a/compiler/rustc_target/src/spec/json.rs +++ b/compiler/rustc_target/src/spec/json.rs @@ -103,6 +103,12 @@ impl Target { base.$key_name = Some(s); } } ); + ($key_name:ident, Option>) => ( { + let name = (stringify!($key_name)).replace("_", "-"); + if let Some(s) = obj.remove(&name).and_then(|b| Some(b.as_str()?.to_string())) { + base.$key_name = Some(s.into()); + } + } ); ($key_name:ident, BinaryFormat) => ( { let name = (stringify!($key_name)).replace("_", "-"); obj.remove(&name).and_then(|f| f.as_str().and_then(|s| { @@ -623,6 +629,7 @@ impl Target { key!(stack_probes, StackProbeType)?; key!(min_global_align, Option); key!(default_codegen_units, Option); + key!(default_codegen_backend, Option>); key!(trap_unreachable, bool); key!(requires_lto, bool); key!(singlethread, bool); @@ -801,6 +808,7 @@ impl ToJson for Target { target_option_val!(stack_probes); target_option_val!(min_global_align); target_option_val!(default_codegen_units); + target_option_val!(default_codegen_backend); target_option_val!(trap_unreachable); target_option_val!(requires_lto); target_option_val!(singlethread);