diff --git a/CHANGELOG.md b/CHANGELOG.md index d170667..b3c171d 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#58](https://github.com/EmbarkStudios/cfg-expr/pull/58) updated the builtin target list to 1.68.2. + ## [0.14.0] - 2023-01-27 ### Changed - [PR#57](https://github.com/EmbarkStudios/cfg-expr/pull/57) updated the builtin target list to 1.67.0. diff --git a/src/expr.rs b/src/expr.rs index ed1f4e1..2e1aa01 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -231,14 +231,15 @@ impl TargetMatcher for target_lexicon::Triple { } Family(fam) => { use target_lexicon::OperatingSystem::{ - AmdHsa, Bitrig, Cloudabi, Cuda, Darwin, Dragonfly, Emscripten, Espidf, Freebsd, - Fuchsia, Haiku, Hermit, Horizon, Illumos, Ios, L4re, Linux, MacOSX, Nebulet, - Netbsd, None_, Openbsd, Redox, Solaris, Tvos, Uefi, Unknown, VxWorks, Wasi, - Watchos, Windows, + Aix, AmdHsa, Bitrig, Cloudabi, Cuda, Darwin, Dragonfly, Emscripten, Espidf, + Freebsd, Fuchsia, Haiku, Hermit, Horizon, Illumos, Ios, L4re, Linux, MacOSX, + Nebulet, Netbsd, None_, Openbsd, Redox, Solaris, Tvos, Uefi, Unknown, VxWorks, + Wasi, Watchos, Windows, }; match self.operating_system { AmdHsa | Bitrig | Cloudabi | Cuda | Hermit | Nebulet | None_ | Uefi => false, - Darwin + Aix + | Darwin | Dragonfly | Espidf | Freebsd diff --git a/src/expr/lexer.rs b/src/expr/lexer.rs index 9bd6e30..a5f0c2d 100644 --- a/src/expr/lexer.rs +++ b/src/expr/lexer.rs @@ -95,12 +95,12 @@ impl<'a> Iterator for Lexer<'a> { #[inline] fn is_ident_start(ch: char) -> bool { - ch == '_' || (('a'..='z').contains(&ch) || ('A'..='Z').contains(&ch)) + ch == '_' || ch.is_ascii_lowercase() || ch.is_ascii_uppercase() } #[inline] fn is_ident_rest(ch: char) -> bool { - is_ident_start(ch) || ('0'..='9').contains(&ch) + is_ident_start(ch) || ch.is_ascii_digit() } match self.inner.chars().next() { diff --git a/src/targets.rs b/src/targets.rs index c906e8f..c4eaf40 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.67.0", cfg_expr::targets::rustc_version()); +/// assert_eq!("1.68.2", cfg_expr::targets::rustc_version()); /// ``` pub fn rustc_version() -> &'static str { builtins::RUSTC_VERSION diff --git a/src/targets/builtins.rs b/src/targets/builtins.rs index 2b06675..8660118 100644 --- a/src/targets/builtins.rs +++ b/src/targets/builtins.rs @@ -10,7 +10,7 @@ use super::*; -pub(crate) const RUSTC_VERSION: &str = "1.67.0"; +pub(crate) const RUSTC_VERSION: &str = "1.68.2"; pub const ALL_BUILTINS: &[TargetInfo] = &[ TargetInfo { @@ -182,6 +182,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-fuchsia"), + os: Some(Os::fuchsia), + abi: None, + arch: Arch::aarch64, + env: None, + vendor: Some(Vendor::unknown), + 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-unknown-hermit"), os: Some(Os::hermit), @@ -637,6 +650,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ has_atomics: HasAtomics::atomic_8_16_32_64_ptr, panic: Panic::unwind, }, + TargetInfo { + triple: Triple::new_const("armv7-sony-vita-newlibeabihf"), + os: Some(Os::vita), + abi: None, + arch: Arch::arm, + env: Some(Env::newlib), + vendor: Some(Vendor::sony), + families: Families::unix, + pointer_width: 32, + endian: Endian::little, + has_atomics: HasAtomics::atomic_8_16_32_ptr, + panic: Panic::abort, + }, TargetInfo { triple: Triple::new_const("armv7-unknown-freebsd"), os: Some(Os::freebsd), @@ -894,7 +920,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ families: Families::new_const(&[]), pointer_width: 64, endian: Endian::big, - has_atomics: HasAtomics::new_const(&[]), + has_atomics: HasAtomics::atomic_64_ptr, panic: Panic::abort, }, TargetInfo { @@ -907,7 +933,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[ families: Families::new_const(&[]), pointer_width: 64, endian: Endian::little, - has_atomics: HasAtomics::new_const(&[]), + has_atomics: HasAtomics::atomic_64_ptr, panic: Panic::abort, }, TargetInfo { @@ -2366,6 +2392,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-fuchsia"), + os: Some(Os::fuchsia), + abi: None, + arch: Arch::x86_64, + 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("x86_64-unknown-haiku"), os: Some(Os::haiku), @@ -2632,6 +2671,7 @@ impl super::Os { pub const tvos: Os = Os::new_const("tvos"); pub const uefi: Os = Os::new_const("uefi"); pub const unknown: Os = Os::new_const("unknown"); + pub const vita: Os = Os::new_const("vita"); pub const vxworks: Os = Os::new_const("vxworks"); pub const wasi: Os = Os::new_const("wasi"); pub const watchos: Os = Os::new_const("watchos"); @@ -2692,6 +2732,7 @@ const __has_atomics_8_16_32_ptr: &[HasAtomic] = &[ HasAtomic::IntegerSize(32), HasAtomic::Pointer, ]; +const __has_atomics_64_ptr: &[HasAtomic] = &[HasAtomic::IntegerSize(64), HasAtomic::Pointer]; impl super::HasAtomics { pub const atomic_8_16_32_64_128_ptr: HasAtomics = @@ -2699,6 +2740,7 @@ impl super::HasAtomics { pub const atomic_8_16_32_64_ptr: HasAtomics = HasAtomics::new_const(__has_atomics_8_16_32_64_ptr); pub const atomic_8_16_32_ptr: HasAtomics = HasAtomics::new_const(__has_atomics_8_16_32_ptr); + pub const atomic_64_ptr: HasAtomics = HasAtomics::new_const(__has_atomics_64_ptr); } impl super::Panic {