diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7c50509d26..b1b9ab259ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,8 +170,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - # 1.60 is the cfg-expr version - toolchain: 1.64.0 + # 1.65 is the cfg-expr version + toolchain: 1.65.0 override: true - uses: Swatinem/rust-cache@v2 - name: Build and test diff --git a/Cargo.lock b/Cargo.lock index b81ae963eb7..1a71af7ae50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -359,9 +359,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" +checksum = "0bbc13bf6290a6b202cc3efb36f7ec2b739a80634215630c8053a313edf6abef" dependencies = [ "smallvec", "target-lexicon", @@ -2180,9 +2180,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" +checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" [[package]] name = "target-spec" diff --git a/target-spec/Cargo.toml b/target-spec/Cargo.toml index f571196888f..ecb8dc4e337 100644 --- a/target-spec/Cargo.toml +++ b/target-spec/Cargo.toml @@ -20,7 +20,7 @@ rustdoc-args = ["--cfg=doc_cfg"] maintenance = { status = "actively-developed" } [dependencies] -cfg-expr = { version = "0.11.0", features = ["targets"] } +cfg-expr = { version = "0.12.0", features = ["targets"] } proptest = { version = "1.0.0", optional = true } serde = { version = "1.0.147", optional = true, features = ["derive"] } target-lexicon = { version = "0.12.4", features = ["std"] } diff --git a/target-spec/src/spec.rs b/target-spec/src/spec.rs index 03d77d145bb..7e2a780005e 100644 --- a/target-spec/src/spec.rs +++ b/target-spec/src/spec.rs @@ -149,7 +149,7 @@ impl FromStr for TargetExpression { mod tests { use super::*; use cfg_expr::{ - targets::{Family, Os}, + targets::{Abi, Arch, Family, Os}, Predicate, TargetPredicate, }; @@ -178,10 +178,23 @@ mod tests { #[test] fn test_target_abi() { - assert!(matches!( - TargetSpec::new("cfg(any(target_arch = \"wasm32\", target_abi = \"unknown\"))"), - Ok(TargetSpec::Expression(_)) - )); + let expr = + match TargetSpec::new("cfg(any(target_arch = \"wasm32\", target_abi = \"unknown\"))") + .unwrap() + { + TargetSpec::Triple(triple) => { + panic!("expected expression, got triple: {:?}", triple) + } + TargetSpec::Expression(expr) => expr, + }; + + assert_eq!( + expr.inner.predicates().collect::>(), + vec![ + Predicate::Target(TargetPredicate::Arch(Arch("wasm32".into()))), + Predicate::Target(TargetPredicate::Abi(Abi("unknown".into()))), + ], + ); } #[test]