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.
This commit is contained in:
parent
c0bd5a584d
commit
84d6e8aed3
9 changed files with 76 additions and 1 deletions
10
src/test/ui/cfg/cfg-target-abi.rs
Normal file
10
src/test/ui/cfg/cfg-target-abi.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// run-pass
|
||||
#![feature(cfg_target_abi)]
|
||||
|
||||
#[cfg(target_abi = "eabihf")]
|
||||
pub fn main() {
|
||||
}
|
||||
|
||||
#[cfg(not(target_abi = "eabihf"))]
|
||||
pub fn main() {
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue