From 2dd4d9bcf938af9881c19edbd73c44db54eb7806 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 26 Jul 2020 22:37:33 +0800 Subject: [PATCH] Avoid warnings with only_i32. --- src/packages/arithmetic.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/packages/arithmetic.rs b/src/packages/arithmetic.rs index 61350996..fd95e675 100644 --- a/src/packages/arithmetic.rs +++ b/src/packages/arithmetic.rs @@ -18,6 +18,8 @@ use num_traits::{ CheckedShr, CheckedSub, }; +#[cfg(not(feature = "only_i32"))] +#[cfg(not(feature = "only_i64"))] use crate::stdlib::ops::{BitAnd, BitOr, BitXor}; #[cfg(any(feature = "unchecked", not(feature = "no_float")))] @@ -145,12 +147,18 @@ where } } // Bit operators +#[cfg(not(feature = "only_i32"))] +#[cfg(not(feature = "only_i64"))] fn binary_and(x: T, y: T) -> FuncReturn<::Output> { Ok(x & y) } +#[cfg(not(feature = "only_i32"))] +#[cfg(not(feature = "only_i64"))] fn binary_or(x: T, y: T) -> FuncReturn<::Output> { Ok(x | y) } +#[cfg(not(feature = "only_i32"))] +#[cfg(not(feature = "only_i64"))] fn binary_xor(x: T, y: T) -> FuncReturn<::Output> { Ok(x ^ y) }