|
7 | 7 | #![warn(missing_docs)] |
8 | 8 | // Will be stabilized in 1.61.0 with https://github.com/rust-lang/rust/pull/90621 |
9 | 9 | #![cfg_attr( |
10 | | - target_arch = "aarch64", |
| 10 | + all(target_arch = "aarch64", feature = "aarch64"), |
11 | 11 | allow(stable_features), |
12 | 12 | feature(aarch64_target_feature) |
13 | 13 | )] |
14 | 14 | #![cfg_attr(feature = "stdsimd", feature(portable_simd))] |
15 | 15 |
|
16 | 16 | /// Substring search implementations using aarch64 architecture features. |
17 | | -#[cfg(target_arch = "aarch64")] |
| 17 | +#[cfg(all(target_arch = "aarch64", feature = "aarch64"))] |
18 | 18 | pub mod aarch64; |
19 | 19 |
|
20 | 20 | /// Substring search implementations using generic stdsimd features. |
@@ -206,7 +206,10 @@ trait Searcher<N: NeedleWithSize + ?Sized> { |
206 | 206 | #[multiversion::multiversion] |
207 | 207 | #[clone(target = "[x86|x86_64]+avx2")] |
208 | 208 | #[clone(target = "wasm32+simd128")] |
209 | | - #[clone(target = "aarch64+neon")] |
| 209 | + #[cfg_attr( |
| 210 | + all(target_arch = "aarch64", feature = "aarch64"), |
| 211 | + clone(target = "aarch64+neon") |
| 212 | + )] |
210 | 213 | unsafe fn vector_search_in_chunk<V: Vector>( |
211 | 214 | &self, |
212 | 215 | hash: &VectorHash<V>, |
@@ -260,7 +263,10 @@ trait Searcher<N: NeedleWithSize + ?Sized> { |
260 | 263 | #[multiversion::multiversion] |
261 | 264 | #[clone(target = "[x86|x86_64]+avx2")] |
262 | 265 | #[clone(target = "wasm32+simd128")] |
263 | | - #[clone(target = "aarch64+neon")] |
| 266 | + #[cfg_attr( |
| 267 | + all(target_arch = "aarch64", feature = "aarch64"), |
| 268 | + clone(target = "aarch64+neon") |
| 269 | + )] |
264 | 270 | unsafe fn vector_search_in<V: Vector>( |
265 | 271 | &self, |
266 | 272 | haystack: &[u8], |
|
0 commit comments