From 56ce971d2e7287198b33840e09d410cd66479a49 Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Mon, 10 Aug 2026 10:23:07 +0300 Subject: [PATCH] cpufeatures: Enable compile time target features under miri --- cpufeatures/CHANGELOG.md | 4 ++++ cpufeatures/src/miri.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cpufeatures/CHANGELOG.md b/cpufeatures/CHANGELOG.md index 50fc3ede..90aa8153 100644 --- a/cpufeatures/CHANGELOG.md +++ b/cpufeatures/CHANGELOG.md @@ -10,8 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Detection of the `avx` target feature ([#1511]) - Use `::MAX` constant instead of deprecated `::max_value()` associated method ([#1515]) +### Changed +- Use compile-time target feature detection under Miri ([#1513]) + [#1511]: https://github.com/RustCrypto/utils/pull/1511 [#1515]: https://github.com/RustCrypto/utils/pull/1515 +[#1513]: https://github.com/RustCrypto/utils/pull/1513 ## 0.3.0 (2026-02-05) ### Added diff --git a/cpufeatures/src/miri.rs b/cpufeatures/src/miri.rs index 8dff21c1..4d0c94da 100644 --- a/cpufeatures/src/miri.rs +++ b/cpufeatures/src/miri.rs @@ -7,7 +7,7 @@ #[doc(hidden)] macro_rules! __unless_target_features { ($($tf:tt),+ => $body:expr ) => { - false + cfg!(all($(target_feature = $tf,)*)) }; }