Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Changed
- [PR#57](https://github.com/EmbarkStudios/cfg-expr/pull/57) updated the builtin target list to 1.67.0.

## [0.13.0] - 2022-12-19
### Changed
- [PR#56](https://github.com/EmbarkStudios/cfg-expr/pull/56) updated the builtin target list to 1.66.0. Thanks [@sunshowers](https://github.com/sunshowers)!
Expand Down
8 changes: 4 additions & 4 deletions src/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl std::str::FromStr for HasAtomic {
impl std::fmt::Display for HasAtomic {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::IntegerSize(size) => write!(f, "{}", size),
Self::IntegerSize(size) => write!(f, "{size}"),
Self::Pointer => write!(f, "ptr"),
}
}
Expand Down Expand Up @@ -183,7 +183,7 @@ impl std::fmt::Display for Families {
write!(f, "{{")?;
let len = self.0.len();
for (idx, family) in self.0.iter().enumerate() {
write!(f, "{}", family)?;
write!(f, "{family}")?;
if idx + 1 < len {
write!(f, ", ")?;
}
Expand Down Expand Up @@ -243,7 +243,7 @@ impl std::fmt::Display for HasAtomics {
write!(f, "{{")?;
let len = self.0.len();
for (idx, has_atomic) in self.0.iter().enumerate() {
write!(f, "{}", has_atomic)?;
write!(f, "{has_atomic}")?;
if idx + 1 < len {
write!(f, ", ")?;
}
Expand Down Expand Up @@ -372,7 +372,7 @@ pub fn get_builtin_target_by_triple(triple: &str) -> Option<&'static TargetInfo>
/// versions.
///
/// ```
/// assert_eq!("1.66.0", cfg_expr::targets::rustc_version());
/// assert_eq!("1.67.0", cfg_expr::targets::rustc_version());
/// ```
pub fn rustc_version() -> &'static str {
builtins::RUSTC_VERSION
Expand Down
72 changes: 58 additions & 14 deletions src/targets/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use super::*;

pub(crate) const RUSTC_VERSION: &str = "1.66.0";
pub(crate) const RUSTC_VERSION: &str = "1.67.0";

pub const ALL_BUILTINS: &[TargetInfo] = &[
TargetInfo {
Expand Down Expand Up @@ -273,6 +273,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
has_atomics: HasAtomics::atomic_8_16_32_64_128_ptr,
panic: Panic::abort,
},
TargetInfo {
triple: Triple::new_const("aarch64-unknown-nto-qnx710"),
os: Some(Os::nto),
abi: None,
arch: Arch::aarch64,
env: Some(Env::nto71),
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-openbsd"),
os: Some(Os::openbsd),
Expand Down Expand Up @@ -1274,6 +1287,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
has_atomics: HasAtomics::atomic_8_16_32_ptr,
panic: Panic::unwind,
},
TargetInfo {
triple: Triple::new_const("mipsel-sony-psx"),
os: None,
abi: None,
arch: Arch::mips,
env: Some(Env::psx),
vendor: Some(Vendor::sony),
families: Families::new_const(&[]),
pointer_width: 32,
endian: Endian::little,
has_atomics: HasAtomics::new_const(&[]),
panic: Panic::abort,
},
TargetInfo {
triple: Triple::new_const("mipsel-unknown-linux-gnu"),
os: Some(Os::linux),
Expand Down Expand Up @@ -1508,6 +1534,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
has_atomics: HasAtomics::atomic_8_16_32_ptr,
panic: Panic::unwind,
},
TargetInfo {
triple: Triple::new_const("powerpc64-ibm-aix"),
os: Some(Os::aix),
abi: None,
arch: Arch::powerpc64,
env: None,
vendor: Some(Vendor::ibm),
families: Families::unix,
pointer_width: 64,
endian: Endian::big,
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
panic: Panic::unwind,
},
TargetInfo {
triple: Triple::new_const("powerpc64-unknown-freebsd"),
os: Some(Os::freebsd),
Expand Down Expand Up @@ -2223,6 +2262,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-pc-nto-qnx710"),
os: Some(Os::nto),
abi: None,
arch: Arch::x86_64,
env: Some(Env::nto71),
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-pc-solaris"),
os: Some(Os::solaris),
Expand Down Expand Up @@ -2431,19 +2483,6 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
panic: Panic::abort,
},
TargetInfo {
triple: Triple::new_const("x86_64-unknown-none-linuxkernel"),
os: None,
abi: None,
arch: Arch::x86_64,
env: Some(Env::gnu),
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("x86_64-unknown-openbsd"),
os: Some(Os::openbsd),
Expand Down Expand Up @@ -2554,6 +2593,7 @@ impl super::Vendor {
pub const apple: Vendor = Vendor::new_const("apple");
pub const espressif: Vendor = Vendor::new_const("espressif");
pub const fortanix: Vendor = Vendor::new_const("fortanix");
pub const ibm: Vendor = Vendor::new_const("ibm");
pub const kmc: Vendor = Vendor::new_const("kmc");
pub const nintendo: Vendor = Vendor::new_const("nintendo");
pub const nvidia: Vendor = Vendor::new_const("nvidia");
Expand All @@ -2566,6 +2606,7 @@ impl super::Vendor {
}

impl super::Os {
pub const aix: Os = Os::new_const("aix");
pub const android: Os = Os::new_const("android");
pub const cuda: Os = Os::new_const("cuda");
pub const dragonfly: Os = Os::new_const("dragonfly");
Expand All @@ -2582,6 +2623,7 @@ impl super::Os {
pub const linux: Os = Os::new_const("linux");
pub const macos: Os = Os::new_const("macos");
pub const netbsd: Os = Os::new_const("netbsd");
pub const nto: Os = Os::new_const("nto");
pub const openbsd: Os = Os::new_const("openbsd");
pub const psp: Os = Os::new_const("psp");
pub const redox: Os = Os::new_const("redox");
Expand Down Expand Up @@ -2622,6 +2664,8 @@ impl super::Env {
pub const msvc: Env = Env::new_const("msvc");
pub const musl: Env = Env::new_const("musl");
pub const newlib: Env = Env::new_const("newlib");
pub const nto71: Env = Env::new_const("nto71");
pub const psx: Env = Env::new_const("psx");
pub const relibc: Env = Env::new_const("relibc");
pub const sgx: Env = Env::new_const("sgx");
pub const uclibc: Env = Env::new_const("uclibc");
Expand Down
10 changes: 5 additions & 5 deletions tests/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Target {
// There are enough new weird architectures added in each version of
// Rust that it is difficult to keep target-lexicon aware of all of
// them. So try parsing this triple, but don't fail if it doesn't work.
eprintln!("failed to parse '{}': {:?}", triple, e);
eprintln!("failed to parse '{triple}': {e:?}");
None
}
},
Expand All @@ -59,8 +59,8 @@ macro_rules! tg_match {
let linfo = tg.matches(l);
assert_eq!(
tinfo, linfo,
"{:#?} builtin didn't match lexicon {:#?} for predicate {:#?}",
$target.builtin, $target.lexicon, tg,
"{:#?} builtin didn't match lexicon {:#?} for predicate {tg:#?}",
$target.builtin, $target.lexicon,
);

return linfo;
Expand All @@ -86,8 +86,8 @@ macro_rules! tg_match {
let linfo = tg.matches(l);
assert_eq!(
tinfo, linfo,
"{:#?} builtin didn't match lexicon {:#?} for predicate {:#?}",
$target.builtin, $target.lexicon, tg,
"{:#?} builtin didn't match lexicon {:#?} for predicate {tg:#?}",
$target.builtin, $target.lexicon,
);

return linfo;
Expand Down