about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2021-07-06 20:54:54 -0700
committerJosh Triplett <josh@joshtriplett.org>2021-07-07 08:52:35 -0700
commit84d6e8aed3af940c53e49e342575e91f502c7bd4 (patch)
tree2091248b3ab1995da65abe55c9d1e5d25c06bf6e /src/tools
parentc0bd5a584da4f26a1391163a0bdc21b34cf1ba54 (diff)
downloadrust-84d6e8aed3af940c53e49e342575e91f502c7bd4.tar.gz
rust-84d6e8aed3af940c53e49e342575e91f502c7bd4.zip
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.

This does not add an abi to any existing target.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tidy/src/pal.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs
index 31cdc6865a4..24a10018779 100644
--- a/src/tools/tidy/src/pal.rs
+++ b/src/tools/tidy/src/pal.rs
@@ -122,6 +122,7 @@ fn check_cfgs(
 
         let contains_platform_specific_cfg = cfg.contains("target_os")
             || cfg.contains("target_env")
+            || cfg.contains("target_abi")
             || cfg.contains("target_vendor")
             || cfg.contains("unix")
             || cfg.contains("windows");