Document int.checked_shl(BITS - 1) · patricklam/verify-rust-std@3e85493

@@ -9,6 +9,7 @@ macro_rules! uint_impl {

99

// literal is fine if they need to be multiple code tokens.

1010

// In non-comments, use the associated constants rather than these.

1111

BITS = $BITS:literal,

12+

BITS_MINUS_ONE = $BITS_MINUS_ONE:literal,

1213

MAX = $MaxV:literal,

1314

rot = $rot:literal,

1415

rot_op = $rot_op:literal,

@@ -1413,6 +1414,7 @@ macro_rules! uint_impl {

14131414

/// ```

14141415

#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".checked_shl(4), Some(0x10));")]

14151416

#[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));")]

14161418

/// ```

14171419

#[stable(feature = "wrapping", since = "1.7.0")]

14181420

#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.47.0")]

@@ -2541,6 +2543,7 @@ macro_rules! uint_impl {

25412543

/// ```

25422544

#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(4), (0x10, false));")]

25432545

#[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));")]

25442547

/// ```

25452548

#[stable(feature = "wrapping", since = "1.7.0")]

25462549

#[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")]