@@ -194,6 +194,7 @@ use crate::crc32::consts::{
194194} ;
195195
196196#[ cfg( any( target_arch = "x86" , target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
197+ #[ cfg( feature = "std" ) ]
197198use crate :: crc32:: fusion;
198199
199200use crate :: crc64:: consts:: {
@@ -947,7 +948,7 @@ fn get_calculator_params(algorithm: CrcAlgorithm) -> (CalculatorFn, CrcParams) {
947948/// fusion techniques to accelerate the calculation beyond what SIMD can do alone.
948949#[ inline( always) ]
949950fn crc32_iscsi_calculator ( state : u64 , data : & [ u8 ] , _params : CrcParams ) -> u64 {
950- #[ cfg( target_arch = "aarch64" ) ]
951+ #[ cfg( all ( target_arch = "aarch64" , feature = "std" ) ) ]
951952 {
952953 use std:: arch:: is_aarch64_feature_detected;
953954 if is_aarch64_feature_detected ! ( "aes" ) && is_aarch64_feature_detected ! ( "crc" ) {
@@ -956,7 +957,7 @@ fn crc32_iscsi_calculator(state: u64, data: &[u8], _params: CrcParams) -> u64 {
956957 }
957958
958959 // both aarch64 and x86 have native CRC-32/ISCSI support, so we can use fusion
959- #[ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
960+ #[ cfg( all ( any( target_arch = "x86_64" , target_arch = "x86" ) , feature = "std ") ) ]
960961 {
961962 use std:: arch:: is_x86_feature_detected;
962963 if is_x86_feature_detected ! ( "sse4.2" ) && is_x86_feature_detected ! ( "pclmulqdq" ) {
@@ -977,7 +978,7 @@ fn crc32_iscsi_calculator(state: u64, data: &[u8], _params: CrcParams) -> u64 {
977978#[ inline( always) ]
978979fn crc32_iso_hdlc_calculator ( state : u64 , data : & [ u8 ] , _params : CrcParams ) -> u64 {
979980 // aarch64 CPUs have native CRC-32/ISO-HDLC support, so we can use the fusion implementation
980- #[ cfg( target_arch = "aarch64" ) ]
981+ #[ cfg( all ( target_arch = "aarch64" , feature = "std" ) ) ]
981982 {
982983 use std:: arch:: is_aarch64_feature_detected;
983984 if is_aarch64_feature_detected ! ( "aes" ) && is_aarch64_feature_detected ! ( "crc" ) {
0 commit comments