@@ -517,6 +517,7 @@ pub struct TargetCfgs {
517517 pub all_abis : HashSet < String > ,
518518 pub all_families : HashSet < String > ,
519519 pub all_pointer_widths : HashSet < String > ,
520+ pub all_rustc_abis : HashSet < String > ,
520521}
521522
522523impl TargetCfgs {
@@ -536,6 +537,9 @@ impl TargetCfgs {
536537 let mut all_abis = HashSet :: new ( ) ;
537538 let mut all_families = HashSet :: new ( ) ;
538539 let mut all_pointer_widths = HashSet :: new ( ) ;
540+ // NOTE: for distinction between `abi` and `rustc_abi`, see comment on
541+ // `TargetCfg::rustc_abi`.
542+ let mut all_rustc_abis = HashSet :: new ( ) ;
539543
540544 // If current target is not included in the `--print=all-target-specs-json` output,
541545 // we check whether it is a custom target from the user or a synthetic target from bootstrap.
@@ -576,7 +580,9 @@ impl TargetCfgs {
576580 all_families. insert ( family. clone ( ) ) ;
577581 }
578582 all_pointer_widths. insert ( format ! ( "{}bit" , cfg. pointer_width) ) ;
579-
583+ if let Some ( rustc_abi) = & cfg. rustc_abi {
584+ all_rustc_abis. insert ( rustc_abi. clone ( ) ) ;
585+ }
580586 all_targets. insert ( target. clone ( ) ) ;
581587 }
582588
@@ -590,6 +596,7 @@ impl TargetCfgs {
590596 all_abis,
591597 all_families,
592598 all_pointer_widths,
599+ all_rustc_abis,
593600 }
594601 }
595602
@@ -676,6 +683,10 @@ pub struct TargetCfg {
676683 pub ( crate ) xray : bool ,
677684 #[ serde( default = "default_reloc_model" ) ]
678685 pub ( crate ) relocation_model : String ,
686+ // NOTE: `rustc_abi` should not be confused with `abi`. `rustc_abi` was introduced in #137037 to
687+ // make SSE2 *required* by the ABI (kind of a hack to make a target feature *required* via the
688+ // target spec).
689+ pub ( crate ) rustc_abi : Option < String > ,
679690
680691 // Not present in target cfg json output, additional derived information.
681692 #[ serde( skip) ]
0 commit comments