Document int.checked_shl(BITS - 1) · model-checking/verify-rust-std@3e85493 (original) (raw)
`@@ -9,6 +9,7 @@ macro_rules! uint_impl {
`
9
9
`// literal is fine if they need to be multiple code tokens.
`
10
10
`// In non-comments, use the associated constants rather than these.
`
11
11
`BITS = $BITS:literal,
`
``
12
`+
BITS_MINUS_ONE = $BITS_MINUS_ONE:literal,
`
12
13
`MAX = $MaxV:literal,
`
13
14
` rot = $rot:literal,
`
14
15
` rot_op = $rot_op:literal,
`
`@@ -1413,6 +1414,7 @@ macro_rules! uint_impl {
`
1413
1414
```` /// ```
`1414`
`1415`
` #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".checked_shl(4), Some(0x10));")]
`
`1415`
`1416`
` #[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".checked_shl(129), None);")]
`
``
`1417`
`+
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".checked_shl(", stringify!($BITS_MINUS_ONE), "), Some(0));")]
`
`1416`
`1418`
```` /// ```
1417
1419
` #[stable(feature = "wrapping", since = "1.7.0")]
`
1418
1420
` #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.47.0")]
`
`@@ -2541,6 +2543,7 @@ macro_rules! uint_impl {
`
2541
2543
```` /// ```
`2542`
`2544`
` #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(4), (0x10, false));")]
`
`2543`
`2545`
` #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(132), (0x10, true));")]
`
``
`2546`
`+
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".overflowing_shl(", stringify!($BITS_MINUS_ONE), "), (0, false));")]
`
`2544`
`2547`
```` /// ```
2545
2548
` #[stable(feature = "wrapping", since = "1.7.0")]
`
2546
2549
` #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")]
`