From 1ac3230ed8036c8c48657e6b2d046b96d76513c7 Mon Sep 17 00:00:00 2001 From: klensy Date: Mon, 7 Aug 2023 21:19:25 +0300 Subject: [PATCH] impl_binary_long allow to pass attribute --- src/int/specialized_div_rem/binary_long.rs | 4 ++++ src/int/specialized_div_rem/mod.rs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/int/specialized_div_rem/binary_long.rs b/src/int/specialized_div_rem/binary_long.rs index 0d782288..2c61a45e 100644 --- a/src/int/specialized_div_rem/binary_long.rs +++ b/src/int/specialized_div_rem/binary_long.rs @@ -13,9 +13,13 @@ macro_rules! impl_binary_long { $n:tt, // the number of bits in a $iX or $uX $uX:ident, // unsigned integer type for the inputs and outputs of `$fn` $iX:ident // signed integer type with same bitwidth as `$uX` + $(, $fun_attr:meta)* // attributes for the function ) => { /// Computes the quotient and remainder of `duo` divided by `div` and returns them as a /// tuple. + $( + #[$fun_attr] + )* pub fn $fn(duo: $uX, div: $uX) -> ($uX, $uX) { let mut duo = duo; // handle edge cases before calling `$normalization_shift` diff --git a/src/int/specialized_div_rem/mod.rs b/src/int/specialized_div_rem/mod.rs index 1ff1d19d..760f5f5b 100644 --- a/src/int/specialized_div_rem/mod.rs +++ b/src/int/specialized_div_rem/mod.rs @@ -306,5 +306,6 @@ impl_binary_long!( u32_normalization_shift, 32, u32, - i32 + i32, + allow(dead_code) );