From f40da91254c30f4379b6a6f9301c9930d352b992 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 16 Apr 2026 15:56:54 +0200 Subject: [PATCH] disable `f16` tests when not `target_has_reliable_f16_math` relevant for the cranelift backend, possibly other cases/targets too --- crates/core_simd/Cargo.toml | 8 ++++++++ crates/core_simd/tests/f16_ops.rs | 3 +++ 2 files changed, 11 insertions(+) diff --git a/crates/core_simd/Cargo.toml b/crates/core_simd/Cargo.toml index 6e576084ecf..05fc63a6a29 100644 --- a/crates/core_simd/Cargo.toml +++ b/crates/core_simd/Cargo.toml @@ -31,3 +31,11 @@ path = "../test_helpers" [dev-dependencies] std_float = { path = "../std_float/", features = ["as_crate"] } + +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = [ + # Internal features aren't marked known config by default, we use these to + # gate tests. + 'cfg(target_has_reliable_f16_math)', +] diff --git a/crates/core_simd/tests/f16_ops.rs b/crates/core_simd/tests/f16_ops.rs index f89bdf4738f..03e239b745f 100644 --- a/crates/core_simd/tests/f16_ops.rs +++ b/crates/core_simd/tests/f16_ops.rs @@ -1,5 +1,7 @@ #![feature(portable_simd)] #![feature(f16)] +#![expect(internal_features)] +#![feature(cfg_target_has_reliable_f16_f128)] #[macro_use] mod ops_macros; @@ -7,4 +9,5 @@ mod ops_macros; // FIXME: some f16 operations cause rustc to hang on wasm simd // https://github.com/llvm/llvm-project/issues/189251 #[cfg(not(all(target_arch = "wasm32", target_feature = "simd128")))] +#[cfg(target_has_reliable_f16_math)] impl_float_tests! { f16, i16 }