Skip to content

Commit 1ac3230

Browse files
committedAug 7, 2023
impl_binary_long allow to pass attribute
1 parent f9beeba commit 1ac3230

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎src/int/specialized_div_rem/binary_long.rs

+4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ macro_rules! impl_binary_long {
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`
1515
$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)
Please sign in to comment.