Skip to content

Commit 1d4c010

Browse files
committed
impl_binary_long allow to pass attribute
1 parent f9beeba commit 1d4c010

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/int/specialized_div_rem/binary_long.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ macro_rules! impl_binary_long {
1212
$normalization_shift:ident, // function for finding the normalization shift
1313
$n:tt, // the number of bits in a $iX or $uX
1414
$uX:ident, // unsigned integer type for the inputs and outputs of `$fn`
15-
$iX:ident // signed integer type with same bitwidth as `$uX`
15+
$iX:ident, // signed integer type with same bitwidth as `$uX`
16+
$($fun_attr:meta),* // attributes for the function
1617
) => {
1718
/// Computes the quotient and remainder of `duo` divided by `div` and returns them as a
1819
/// tuple.
20+
$(
21+
#[$fun_attr]
22+
)*
1923
pub fn $fn(duo: $uX, div: $uX) -> ($uX, $uX) {
2024
let mut duo = duo;
2125
// handle edge cases before calling `$normalization_shift`

src/int/specialized_div_rem/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -306,5 +306,6 @@ impl_binary_long!(
306306
u32_normalization_shift,
307307
32,
308308
u32,
309-
i32
309+
i32,
310+
allow(dead_code)
310311
);

0 commit comments

Comments
 (0)