diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e711b..f1bcfb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate +### Changed +- [PR#66](https://github.com/EmbarkStudios/cfg-expr/pull/66) updated the builtin target list to 1.75.0. + ## [0.15.5] - 2023-09-08 ### Changed - [PR#64](https://github.com/EmbarkStudios/cfg-expr/pull/64) updated the builtin target list to 1.72.0. It also changed the MSRV to 1.70.0. diff --git a/README.md b/README.md index 752df23..35e1243 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ # `⚙️ cfg-expr` -**A parser and evaluator for Rust `cfg()` expressions. Builtin targets as of [Rust 1.72.0](https://forge.rust-lang.org/release/platform-support.html) are supported.** +**A parser and evaluator for Rust `cfg()` expressions. Builtin targets as of [Rust 1.75.0](https://forge.rust-lang.org/release/platform-support.html) are supported.** [![Build Status](https://github.com/EmbarkStudios/cfg-expr/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/cfg-expr/actions?workflow=CI) [![Crates.io](https://img.shields.io/crates/v/cfg-expr.svg)](https://crates.io/crates/cfg-expr) [![Docs](https://docs.rs/cfg-expr/badge.svg)](https://docs.rs/cfg-expr) -[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust%20MSRV-1.58.0-blue?color=fc8d62&logo=rust)](https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html) -[![Rust Targets](https://img.shields.io/badge/Rust%20Targets-1.69.0-blue.svg)](https://forge.rust-lang.org/release/platform-support.html) +[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust%20MSRV-1.70.0-blue?color=fc8d62&logo=rust)](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html) +[![Rust Targets](https://img.shields.io/badge/Rust%20Targets-1.75.0-blue.svg)](https://forge.rust-lang.org/release/platform-support.html) [![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) [![Embark](https://img.shields.io/badge/embark-open%20source-blueviolet.svg)](https://embark.dev) @@ -22,7 +22,7 @@ `cfg-expr` is a crate that can be used to parse and evaluate Rust `cfg()` expressions, both as declarable in Rust code itself, as well in cargo manifests' `[target.'cfg()'.dependencies]` sections. -It contains a list of all builtin targets known to rustc as of `1.72.0` that can be used to determine if a particular cfg expression is satisfiable. +It contains a list of all builtin targets known to rustc as of `1.75.0` that can be used to determine if a particular cfg expression is satisfiable. ```rust use cfg_expr::{targets::get_builtin_target_by_triple, Expression, Predicate}; diff --git a/clippy.toml b/clippy.toml index aed39d9..cda8d17 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,2 +1 @@ -msrv = "1.58.0" avoid-breaking-exported-api = false diff --git a/src/expr.rs b/src/expr.rs index 735ce48..faf8916 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -124,6 +124,20 @@ impl TargetMatcher for target_lexicon::Triple { } else if arch == &targ::Arch::x86_64 { self.architecture == Architecture::X86_64 || self.architecture == Architecture::X86_64h + } else if arch == &targ::Arch::mips32r6 { + matches!( + self.architecture, + Architecture::Mips32( + Mips32Architecture::Mipsisa32r6 | Mips32Architecture::Mipsisa32r6el + ) + ) + } else if arch == &targ::Arch::mips64r6 { + matches!( + self.architecture, + Architecture::Mips64( + Mips64Architecture::Mipsisa64r6 | Mips64Architecture::Mipsisa64r6el + ) + ) } else { match arch.0.parse::() { Ok(a) => match (self.architecture, a) { diff --git a/src/targets.rs b/src/targets.rs index ec737f3..ebe9348 100644 --- a/src/targets.rs +++ b/src/targets.rs @@ -372,7 +372,7 @@ pub fn get_builtin_target_by_triple(triple: &str) -> Option<&'static TargetInfo> /// versions. /// /// ``` -/// assert_eq!("1.72.0", cfg_expr::targets::rustc_version()); +/// assert_eq!("1.75.0", cfg_expr::targets::rustc_version()); /// ``` pub fn rustc_version() -> &'static str { builtins::RUSTC_VERSION @@ -397,7 +397,7 @@ mod test { #[test] fn has_ios() { assert_eq!( - 8, + 7, super::ALL_BUILTINS .iter() .filter(|ti| ti.os == Some(super::Os::ios)) diff --git a/src/targets/builtins.rs b/src/targets/builtins.rs index 8e69758..55280ff 100644 --- a/src/targets/builtins.rs +++ b/src/targets/builtins.rs @@ -10,7 +10,7 @@ use super::*; -pub(crate) const RUSTC_VERSION: &str = "1.72.0"; +pub(crate) const RUSTC_VERSION: &str = "1.75.0"; pub const ALL_BUILTINS: &[TargetInfo] = &[ TargetInfo { @@ -78,6 +78,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_128_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("aarch64-apple-tvos-sim"), + os: Some(Os::tvos), + abi: None, + arch: Arch::aarch64, + env: None, + vendor: Some(Vendor::apple), + families: Families::unix, + pointer_width: 64, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_128_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("aarch64-apple-watchos-sim"), os: Some(Os::watchos), @@ -338,6 +351,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_128_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("aarch64-unknown-teeos"), + os: Some(Os::teeos), + abi: None, + arch: Arch::aarch64, + env: None, + vendor: Some(Vendor::unknown), + families: Families::new_const(&[]), + pointer_width: 64, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_128_ptr, + panic: Panic::abort, + }, TargetInfo { triple: Triple::new_const("aarch64-unknown-uefi"), os: Some(Os::uefi), @@ -650,19 +676,6 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_ptr, panic: Panic::unwind, }, - TargetInfo { - triple: Triple::new_const("armv7-apple-ios"), - os: Some(Os::ios), - abi: None, - arch: Arch::arm, - env: None, - vendor: Some(Vendor::apple), - families: Families::unix, - pointer_width: 32, - endian: Endian::little, - has_atomics: HasAtomics::atomic_8_16_32_64_ptr, - panic: Panic::unwind, - }, TargetInfo { triple: Triple::new_const("armv7-linux-androideabi"), os: Some(Os::android), @@ -975,6 +988,32 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::new_const(&[]), panic: Panic::abort, }, + TargetInfo { + triple: Triple::new_const("csky-unknown-linux-gnuabiv2"), + os: Some(Os::linux), + abi: None, + arch: Arch::csky, + env: Some(Env::gnu), + vendor: Some(Vendor::unknown), + families: Families::unix, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_ptr, + panic: Panic::unwind, + }, + TargetInfo { + triple: Triple::new_const("csky-unknown-linux-gnuabiv2hf"), + os: Some(Os::linux), + abi: None, + arch: Arch::csky, + env: Some(Env::gnu), + vendor: Some(Vendor::unknown), + families: Families::unix, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("hexagon-unknown-linux-musl"), os: Some(Os::linux), @@ -1053,6 +1092,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("i586-unknown-netbsd"), + os: Some(Os::netbsd), + abi: None, + arch: Arch::x86, + env: None, + vendor: Some(Vendor::unknown), + families: Families::unix, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("i686-apple-darwin"), os: Some(Os::macos), @@ -1092,6 +1144,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("i686-pc-windows-gnullvm"), + os: Some(Os::windows), + abi: None, + arch: Arch::x86, + env: Some(Env::gnu), + vendor: Some(Vendor::pc), + families: Families::windows, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("i686-pc-windows-msvc"), os: Some(Os::windows), @@ -1131,6 +1196,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("i686-unknown-hurd-gnu"), + os: Some(Os::hurd), + abi: None, + arch: Arch::x86, + env: Some(Env::gnu), + vendor: Some(Vendor::unknown), + families: Families::unix, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("i686-unknown-linux-gnu"), os: Some(Os::linux), @@ -1456,6 +1534,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("mipsel-unknown-netbsd"), + os: Some(Os::netbsd), + abi: None, + arch: Arch::mips, + env: None, + vendor: Some(Vendor::unknown), + families: Families::unix, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("mipsel-unknown-none"), os: None, @@ -1473,7 +1564,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ triple: Triple::new_const("mipsisa32r6-unknown-linux-gnu"), os: Some(Os::linux), abi: None, - arch: Arch::mips, + arch: Arch::mips32r6, env: Some(Env::gnu), vendor: Some(Vendor::unknown), families: Families::unix, @@ -1486,7 +1577,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ triple: Triple::new_const("mipsisa32r6el-unknown-linux-gnu"), os: Some(Os::linux), abi: None, - arch: Arch::mips, + arch: Arch::mips32r6, env: Some(Env::gnu), vendor: Some(Vendor::unknown), families: Families::unix, @@ -1499,7 +1590,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ triple: Triple::new_const("mipsisa64r6-unknown-linux-gnuabi64"), os: Some(Os::linux), abi: None, - arch: Arch::mips64, + arch: Arch::mips64r6, env: Some(Env::gnu), vendor: Some(Vendor::unknown), families: Families::unix, @@ -1512,7 +1603,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ triple: Triple::new_const("mipsisa64r6el-unknown-linux-gnuabi64"), os: Some(Os::linux), abi: None, - arch: Arch::mips64, + arch: Arch::mips64r6, env: Some(Env::gnu), vendor: Some(Vendor::unknown), families: Families::unix, @@ -1830,7 +1921,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ families: Families::unix, pointer_width: 32, endian: Endian::little, - has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + has_atomics: HasAtomics::atomic_8_16_32_ptr, panic: Panic::abort, }, TargetInfo { @@ -1869,7 +1960,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ families: Families::unix, pointer_width: 32, endian: Endian::little, - has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + has_atomics: HasAtomics::atomic_8_16_32_ptr, panic: Panic::abort, }, TargetInfo { @@ -1885,6 +1976,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::new_const(&[]), panic: Panic::abort, }, + TargetInfo { + triple: Triple::new_const("riscv64-linux-android"), + os: Some(Os::android), + abi: None, + arch: Arch::riscv64, + env: None, + vendor: Some(Vendor::unknown), + families: Families::unix, + pointer_width: 64, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("riscv64gc-unknown-freebsd"), os: Some(Os::freebsd), @@ -1911,6 +2015,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("riscv64gc-unknown-hermit"), + os: Some(Os::hermit), + abi: None, + arch: Arch::riscv64, + env: None, + vendor: Some(Vendor::unknown), + families: Families::new_const(&[]), + pointer_width: 64, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::abort, + }, TargetInfo { triple: Triple::new_const("riscv64gc-unknown-linux-gnu"), os: Some(Os::linux), @@ -2025,9 +2142,22 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ families: Families::unix, pointer_width: 32, endian: Endian::big, - has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + has_atomics: HasAtomics::atomic_8_16_32_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("sparc-unknown-none-elf"), + os: None, + abi: None, + arch: Arch::sparc, + env: None, + vendor: Some(Vendor::unknown), + families: Families::new_const(&[]), + pointer_width: 32, + endian: Endian::big, + has_atomics: HasAtomics::atomic_8_16_32_ptr, + panic: Panic::abort, + }, TargetInfo { triple: Triple::new_const("sparc64-unknown-linux-gnu"), os: Some(Os::linux), @@ -2301,6 +2431,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::abort, }, + TargetInfo { + triple: Triple::new_const("wasm32-wasi-preview1-threads"), + os: Some(Os::wasi), + abi: None, + arch: Arch::wasm32, + env: None, + vendor: Some(Vendor::unknown), + families: Families::wasm, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::abort, + }, TargetInfo { triple: Triple::new_const("wasm64-unknown-unknown"), os: Some(Os::unknown), @@ -2496,6 +2639,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("x86_64-unikraft-linux-musl"), + os: Some(Os::linux), + abi: None, + arch: Arch::x86_64, + env: Some(Env::musl), + vendor: Some(Vendor::unikraft), + families: Families::unix, + pointer_width: 64, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::abort, + }, TargetInfo { triple: Triple::new_const("x86_64-unknown-dragonfly"), os: Some(Os::dragonfly), @@ -2626,6 +2782,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("x86_64-unknown-linux-ohos"), + os: Some(Os::linux), + abi: None, + arch: Arch::x86_64, + env: Some(Env::ohos), + vendor: Some(Vendor::unknown), + families: Families::unix, + pointer_width: 64, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_64_ptr, + panic: Panic::unwind, + }, TargetInfo { triple: Triple::new_const("x86_64-unknown-netbsd"), os: Some(Os::netbsd), @@ -2752,11 +2921,14 @@ impl super::Arch { pub const arm: Arch = Arch::new_const("arm"); pub const avr: Arch = Arch::new_const("avr"); pub const bpf: Arch = Arch::new_const("bpf"); + pub const csky: Arch = Arch::new_const("csky"); pub const hexagon: Arch = Arch::new_const("hexagon"); pub const loongarch64: Arch = Arch::new_const("loongarch64"); pub const m68k: Arch = Arch::new_const("m68k"); pub const mips: Arch = Arch::new_const("mips"); + pub const mips32r6: Arch = Arch::new_const("mips32r6"); pub const mips64: Arch = Arch::new_const("mips64"); + pub const mips64r6: Arch = Arch::new_const("mips64r6"); pub const msp430: Arch = Arch::new_const("msp430"); pub const nvptx64: Arch = Arch::new_const("nvptx64"); pub const powerpc: Arch = Arch::new_const("powerpc"); @@ -2783,6 +2955,7 @@ impl super::Vendor { pub const pc: Vendor = Vendor::new_const("pc"); pub const sony: Vendor = Vendor::new_const("sony"); pub const sun: Vendor = Vendor::new_const("sun"); + pub const unikraft: Vendor = Vendor::new_const("unikraft"); pub const unknown: Vendor = Vendor::new_const("unknown"); pub const uwp: Vendor = Vendor::new_const("uwp"); pub const wrs: Vendor = Vendor::new_const("wrs"); @@ -2800,6 +2973,7 @@ impl super::Os { pub const haiku: Os = Os::new_const("haiku"); pub const hermit: Os = Os::new_const("hermit"); pub const horizon: Os = Os::new_const("horizon"); + pub const hurd: Os = Os::new_const("hurd"); pub const illumos: Os = Os::new_const("illumos"); pub const ios: Os = Os::new_const("ios"); pub const l4re: Os = Os::new_const("l4re"); @@ -2812,6 +2986,7 @@ impl super::Os { pub const redox: Os = Os::new_const("redox"); pub const solaris: Os = Os::new_const("solaris"); pub const solid_asp3: Os = Os::new_const("solid_asp3"); + pub const teeos: Os = Os::new_const("teeos"); pub const tvos: Os = Os::new_const("tvos"); pub const uefi: Os = Os::new_const("uefi"); pub const unknown: Os = Os::new_const("unknown");