Skip to content

Commit 4f532da

Browse files
authored
Rollup merge of #108279 - Nilstrieb:int, r=scottmcm
Use named arguments for `{,u}int_impls` macro This makes it way easier to understand. r? `@scottmcm`
2 parents ea7ca70 + eb5d82b commit 4f532da

File tree

3 files changed

+356
-78
lines changed

3 files changed

+356
-78
lines changed

library/core/src/num/int_macros.rs

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
macro_rules! int_impl {
2-
($SelfT:ty, $ActualT:ident, $UnsignedT:ty, $BITS:expr, $BITS_MINUS_ONE:expr, $Min:expr, $Max:expr,
3-
$rot:expr, $rot_op:expr, $rot_result:expr, $swap_op:expr, $swapped:expr,
4-
$reversed:expr, $le_bytes:expr, $be_bytes:expr,
5-
$to_xe_bytes_doc:expr, $from_xe_bytes_doc:expr,
6-
$bound_condition:expr) => {
2+
(
3+
Self = $SelfT:ty,
4+
ActualT = $ActualT:ident,
5+
UnsignedT = $UnsignedT:ty,
6+
BITS = $BITS:expr,
7+
BITS_MINUS_ONE = $BITS_MINUS_ONE:expr,
8+
Min = $Min:expr,
9+
Max = $Max:expr,
10+
rot = $rot:expr,
11+
rot_op = $rot_op:expr,
12+
rot_result = $rot_result:expr,
13+
swap_op = $swap_op:expr,
14+
swapped = $swapped:expr,
15+
reversed = $reversed:expr,
16+
le_bytes = $le_bytes:expr,
17+
be_bytes = $be_bytes:expr,
18+
to_xe_bytes_doc = $to_xe_bytes_doc:expr,
19+
from_xe_bytes_doc = $from_xe_bytes_doc:expr,
20+
bound_condition = $bound_condition:expr,
21+
) => {
722
/// The smallest value that can be represented by this integer type
823
#[doc = concat!("(&minus;2<sup>", $BITS_MINUS_ONE, "</sup>", $bound_condition, ").")]
924
///

0 commit comments

Comments
 (0)