diff options
| author | bors <bors@rust-lang.org> | 2021-07-13 12:25:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-13 12:25:10 +0000 |
| commit | ca99e3eb3adf61573b11d859ce2b9ff7db48ccd4 (patch) | |
| tree | 4358d504c5ce2e1fe670ae4d3bbebc74a03d5f48 /compiler/rustc_feature/src | |
| parent | 5aff6dd07a562a2cba3c57fc3460a72acb6bef46 (diff) | |
| parent | c3fbafddc06fda5f282790c9c16378d7786cbe03 (diff) | |
| download | rust-ca99e3eb3adf61573b11d859ce2b9ff7db48ccd4.tar.gz rust-ca99e3eb3adf61573b11d859ce2b9ff7db48ccd4.zip | |
Auto merge of #86922 - joshtriplett:target-abi, r=oli-obk
target abi Implement cfg(target_abi) (RFC 2992) Add an `abi` field to `TargetOptions`, defaulting to "". Support using `cfg(target_abi = "...")` for conditional compilation on that field. Gated by `feature(cfg_target_abi)`. Add a test for `target_abi`, and a test for the feature gate. Add `target_abi` to tidy as a platform-specific cfg. Update targets to use `target_abi` All eabi targets have `target_abi = "eabi".` All eabihf targets have `target_abi = "eabihf"`. `armv6_unknown_freebsd` and `armv7_unknown_freebsd` have `target_abi = "eabihf"`. All abi64 targets have `target_abi = "abi64"`. All ilp32 targets have `target_abi = "ilp32"`. All softfloat targets have `target_abi = "softfloat"`. All *-uwp-windows-* targets have `target_abi = "uwp"`. All spe targets have `target_abi = "spe"`. All macabi targets have `target_abi = "macabi"`. aarch64-apple-ios-sim has `target_abi = "sim"`. `x86_64-fortanix-unknown-sgx` has `target_abi = "fortanix"`. `x86_64-unknown-linux-gnux32` has `target_abi = "x32"`. Add FIXME entries for targets for which existing values need to change once `cfg_target_abi` becomes stable. (All of them are tier 3 targets.) Add a test for `target_abi` in `--print cfg`.
Diffstat (limited to 'compiler/rustc_feature/src')
| -rw-r--r-- | compiler/rustc_feature/src/active.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_feature/src/builtin_attrs.rs | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 9eaf4693811..ede510b6936 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -684,6 +684,9 @@ declare_features! ( /// Allows qualified paths in struct expressions, struct patterns and tuple struct patterns. (active, more_qualified_paths, "1.54.0", Some(86935), None), + /// Allows `cfg(target_abi = "...")`. + (active, cfg_target_abi, "1.55.0", Some(80970), None), + // ------------------------------------------------------------------------- // feature-group-end: actual feature gates // ------------------------------------------------------------------------- diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 24a5a007ded..77d8f0f920c 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -23,6 +23,7 @@ pub type GatedCfg = (Symbol, Symbol, GateFn); /// `cfg(...)`'s that are feature gated. const GATED_CFGS: &[GatedCfg] = &[ // (name in cfg, feature, function to check if the feature is enabled) + (sym::target_abi, sym::cfg_target_abi, cfg_fn!(cfg_target_abi)), (sym::target_thread_local, sym::cfg_target_thread_local, cfg_fn!(cfg_target_thread_local)), (sym::target_has_atomic, sym::cfg_target_has_atomic, cfg_fn!(cfg_target_has_atomic)), (sym::target_has_atomic_load_store, sym::cfg_target_has_atomic, cfg_fn!(cfg_target_has_atomic)), |
