From 2e081c03c50477734112f1947e1434987930a9d3 Mon Sep 17 00:00:00 2001 From: Solomon Ucko Date: Sun, 14 Aug 2022 15:44:16 -0400 Subject: [PATCH] add #[cfg(feature = "num-bigint")] to some test helper functions --- src/tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tests.rs b/src/tests.rs index 9fad651..67575f1 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -33,6 +33,7 @@ conversion_tests!(i64, test_i64); conversion_tests!(u128, test_u128); conversion_tests!(i128, test_i128); +#[cfg(feature = "num-bigint")] fn run_tests_u_inner(test: impl Fn(BigUint)) { for i in 0u8..=7 { test(BigUint::from(i)); @@ -52,6 +53,7 @@ fn run_tests_u_inner(test: impl Fn(BigUint)) { } #[allow(dead_code)] +#[cfg(feature = "num-bigint")] fn run_tests_u_1(small: impl Fn(SmallUint) -> T, big: impl Fn(&BigUint) -> T) { run_tests_u_inner(|i| { let small_result = small(SmallUint::from(&i)); @@ -64,6 +66,7 @@ fn run_tests_u_1(small: impl Fn(SmallUint) -> T, big: impl Fn(&Bi }); } +#[cfg(feature = "num-bigint")] fn run_tests_u_2( small: impl Fn(SmallUint, SmallUint) -> T, big: impl Fn(&BigUint, &BigUint) -> T @@ -79,6 +82,7 @@ fn run_tests_u_2( })); } +#[cfg(feature = "num-bigint")] fn run_tests_i_inner(test: impl Fn(BigInt)) { run_tests_u_inner(|value| { test(BigInt::from_biguint(Sign::Plus, value.clone())); @@ -86,6 +90,7 @@ fn run_tests_i_inner(test: impl Fn(BigInt)) { }); } +#[cfg(feature = "num-bigint")] fn run_tests_i_1(small: impl Fn(SmallInt) -> T, big: impl Fn(&BigInt) -> T) { run_tests_i_inner(|i| { let small_result = small(SmallInt::from(&i)); @@ -98,6 +103,7 @@ fn run_tests_i_1(small: impl Fn(SmallInt) -> T, big: impl Fn(&Big }); } +#[cfg(feature = "num-bigint")] fn run_tests_i_2( small: impl Fn(SmallInt, SmallInt) -> T, big: impl Fn(&BigInt, &BigInt) -> T