Skip to content

Commit 7454058

Browse files
authored
Update to 1.87 (#79)
* Update to 1.87 * Remove i586 from README
1 parent 432d1f4 commit 7454058

File tree

4 files changed

+43
-45
lines changed

4 files changed

+43
-45
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
<!-- next-header -->
1111
## [Unreleased] - ReleaseDate
12+
### Changed
13+
- [PR#79](https://github.com/EmbarkStudios/cfg-expr/pull/79) updated the builtin target list to 1.87.0.
14+
1215
## [0.19.0] - 2025-04-03
1316
### Changed
1417
- [PR#78](https://github.com/EmbarkStudios/cfg-expr/pull/78) updated the builtin target list to 1.86.0.

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
# `⚙️ cfg-expr`
66

7-
**A parser and evaluator for Rust `cfg()` expressions. Builtin targets as of [1.86.0] are supported.**
7+
**A parser and evaluator for Rust `cfg()` expressions. Builtin targets as of [1.87.0] are supported.**
88

99
[![Build Status](https://github.com/EmbarkStudios/cfg-expr/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/cfg-expr/actions?workflow=CI)
1010
[![Crates.io](https://img.shields.io/crates/v/cfg-expr.svg)](https://crates.io/crates/cfg-expr)
1111
[![Docs](https://docs.rs/cfg-expr/badge.svg)](https://docs.rs/cfg-expr)
1212
[![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)
13-
[![Rust Targets](https://img.shields.io/badge/Rust%20Targets-1.86.0-blue.svg)](https://forge.rust-lang.org/release/platform-support.html)
13+
[![Rust Targets](https://img.shields.io/badge/Rust%20Targets-1.87.0-blue.svg)](https://forge.rust-lang.org/release/platform-support.html)
1414
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
1515
[![Embark](https://img.shields.io/badge/embark-open%20source-blueviolet.svg)](https://embark.dev)
1616
</div>
@@ -24,7 +24,7 @@
2424

2525
`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.
2626

27-
It contains a list of all builtin targets known to rustc as of [1.86.0] that can be used to determine if a particular cfg expression is satisfiable.
27+
It contains a list of all builtin targets known to rustc as of [1.87.0] that can be used to determine if a particular cfg expression is satisfiable.
2828

2929
```rust
3030
use cfg_expr::{targets::get_builtin_target_by_triple, Expression, Predicate};
@@ -47,7 +47,6 @@ let specific = Expression::parse(
4747

4848
// cfg_expr includes a list of every builtin target in rustc
4949
let x86_win = get_builtin_target_by_triple("i686-pc-windows-msvc").unwrap();
50-
let x86_pentium_win = get_builtin_target_by_triple("i586-pc-windows-msvc").unwrap();
5150
let uwp_win = get_builtin_target_by_triple("i686-uwp-windows-msvc").unwrap();
5251
let mac = get_builtin_target_by_triple("x86_64-apple-darwin").unwrap();
5352

@@ -63,15 +62,6 @@ assert!(specific.eval(|pred| {
6362
}
6463
}));
6564

66-
// This won't, it doesn't have the cool_thing feature!
67-
assert!(!specific.eval(|pred| {
68-
match pred {
69-
Predicate::Target(tp) => tp.matches(x86_pentium_win),
70-
Predicate::TargetFeature(feat) => avail_target_feats.contains(feat),
71-
_ => false,
72-
}
73-
}));
74-
7565
// This will *not* satisfy the vendor predicate
7666
assert!(!specific.eval(|pred| {
7767
match pred {
@@ -110,4 +100,4 @@ at your option.
110100

111101
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
112102

113-
[1.86.0]: (https://forge.rust-lang.org/release/platform-support.html)
103+
[1.87.0]: (https://forge.rust-lang.org/release/platform-support.html)

src/expr.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ impl TargetMatcher for target_lexicon::Triple {
109109
target_lexicon::Vendor::Custom(target_lexicon::CustomVendor::Static("nuttx"));
110110
const RTEMS: target_lexicon::Vendor =
111111
target_lexicon::Vendor::Custom(target_lexicon::CustomVendor::Static("rtems"));
112+
const WALI: target_lexicon::Vendor =
113+
target_lexicon::Vendor::Custom(target_lexicon::CustomVendor::Static("wali"));
112114

113115
match tp {
114116
Abi(_) => {
@@ -315,6 +317,9 @@ impl TargetMatcher for target_lexicon::Triple {
315317
_ => false,
316318
}
317319
}
320+
Linux if self.vendor == WALI => {
321+
fam == &crate::targets::Family::wasm || fam == &crate::targets::Family::unix
322+
}
318323
Linux => {
319324
// The 'kernel' environment is treated specially as not-unix
320325
if self.environment != Environment::Kernel {
@@ -375,7 +380,7 @@ impl TargetMatcher for target_lexicon::Triple {
375380
Vendor(ven) => match ven.0.parse::<target_lexicon::Vendor>() {
376381
Ok(v) => {
377382
if self.vendor == v
378-
|| ((self.vendor == NUTTX || self.vendor == RTEMS)
383+
|| ((self.vendor == NUTTX || self.vendor == RTEMS || self.vendor == WALI)
379384
&& ven == &targ::Vendor::unknown)
380385
{
381386
true

src/targets/builtins.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use super::*;
1212

13-
pub(crate) const RUSTC_VERSION: &str = "1.86.0";
13+
pub(crate) const RUSTC_VERSION: &str = "1.87.0";
1414

1515
pub const ALL_BUILTINS: &[TargetInfo] = &[
1616
TargetInfo {
@@ -1171,11 +1171,11 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
11711171
panic: Panic::abort,
11721172
},
11731173
TargetInfo {
1174-
triple: Triple::new_const("avr-unknown-gnu-atmega328"),
1174+
triple: Triple::new_const("avr-none"),
11751175
os: None,
11761176
abi: None,
11771177
arch: Arch::avr,
1178-
env: Some(Env::gnu),
1178+
env: None,
11791179
vendor: Some(Vendor::unknown),
11801180
families: Families::new_const(&[]),
11811181
pointer_width: 16,
@@ -1274,32 +1274,6 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
12741274
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
12751275
panic: Panic::unwind,
12761276
},
1277-
TargetInfo {
1278-
triple: Triple::new_const("i586-pc-nto-qnx700"),
1279-
os: Some(Os::nto),
1280-
abi: None,
1281-
arch: Arch::x86,
1282-
env: Some(Env::nto70),
1283-
vendor: Some(Vendor::pc),
1284-
families: Families::unix,
1285-
pointer_width: 32,
1286-
endian: Endian::little,
1287-
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
1288-
panic: Panic::unwind,
1289-
},
1290-
TargetInfo {
1291-
triple: Triple::new_const("i586-pc-windows-msvc"),
1292-
os: Some(Os::windows),
1293-
abi: None,
1294-
arch: Arch::x86,
1295-
env: Some(Env::msvc),
1296-
vendor: Some(Vendor::pc),
1297-
families: Families::windows,
1298-
pointer_width: 32,
1299-
endian: Endian::little,
1300-
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
1301-
panic: Panic::unwind,
1302-
},
13031277
TargetInfo {
13041278
triple: Triple::new_const("i586-unknown-linux-gnu"),
13051279
os: Some(Os::linux),
@@ -1378,6 +1352,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
13781352
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
13791353
panic: Panic::unwind,
13801354
},
1355+
TargetInfo {
1356+
triple: Triple::new_const("i686-pc-nto-qnx700"),
1357+
os: Some(Os::nto),
1358+
abi: None,
1359+
arch: Arch::x86,
1360+
env: Some(Env::nto70),
1361+
vendor: Some(Vendor::pc),
1362+
families: Families::unix,
1363+
pointer_width: 32,
1364+
endian: Endian::little,
1365+
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
1366+
panic: Panic::unwind,
1367+
},
13811368
TargetInfo {
13821369
triple: Triple::new_const("i686-pc-windows-gnu"),
13831370
os: Some(Os::windows),
@@ -3068,6 +3055,19 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
30683055
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
30693056
panic: Panic::abort,
30703057
},
3058+
TargetInfo {
3059+
triple: Triple::new_const("wasm32-wali-linux-musl"),
3060+
os: Some(Os::linux),
3061+
abi: None,
3062+
arch: Arch::wasm32,
3063+
env: Some(Env::musl),
3064+
vendor: Some(Vendor::unknown),
3065+
families: Families::unix_wasm,
3066+
pointer_width: 32,
3067+
endian: Endian::little,
3068+
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
3069+
panic: Panic::abort,
3070+
},
30713071
TargetInfo {
30723072
triple: Triple::new_const("wasm32-wasip1"),
30733073
os: Some(Os::wasi),
@@ -3377,7 +3377,7 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
33773377
families: Families::unix,
33783378
pointer_width: 64,
33793379
endian: Endian::little,
3380-
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
3380+
has_atomics: HasAtomics::atomic_8_16_32_64_128_ptr,
33813381
panic: Panic::unwind,
33823382
},
33833383
TargetInfo {

0 commit comments

Comments
 (0)