]> git.lizzy.rs Git - rust.git/commit
Implement cfg(target_abi) (RFC 2992)
authorJosh Triplett <josh@joshtriplett.org>
Wed, 7 Jul 2021 03:54:54 +0000 (20:54 -0700)
committerJosh Triplett <josh@joshtriplett.org>
Wed, 7 Jul 2021 15:52:35 +0000 (08:52 -0700)
commit84d6e8aed3af940c53e49e342575e91f502c7bd4
tree2091248b3ab1995da65abe55c9d1e5d25c06bf6e
parentc0bd5a584da4f26a1391163a0bdc21b34cf1ba54
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.
compiler/rustc_feature/src/active.rs
compiler/rustc_feature/src/builtin_attrs.rs
compiler/rustc_session/src/config.rs
compiler/rustc_span/src/symbol.rs
compiler/rustc_target/src/spec/mod.rs
src/test/ui/cfg/cfg-target-abi.rs [new file with mode: 0644]
src/test/ui/feature-gates/feature-gate-cfg-target-abi.rs [new file with mode: 0644]
src/test/ui/feature-gates/feature-gate-cfg-target-abi.stderr [new file with mode: 0644]
src/tools/tidy/src/pal.rs