I have a crate that provides fonctions that are enabled only for a specific architecture and specific feature.
For exemple, I have a function that is enabled only for
aarch64 with feature
In this function I use intrinsics like
core::arch::aarch64::__crc32cb that is unstable and it need the crate-level feature
I still want to be able to compile the crate with stable rust if we don't use the feature
crc. But If the user want
crc feature, I want to enable the
stdsimd feature only in that case.
The problem I have is that i don't know how i can add
#![feature(stdsimd)] only if
target_feature = "crc" is enabled.
Is there a way to do that? how can i manage this properly?