Skip to content

Commit

Permalink
fix(core): Add #![feature(unbounded_shifts)] to doctests for `unbou…
Browse files Browse the repository at this point in the history
…nded_shr`/`unbounded_shl`
  • Loading branch information
chorman0773 committed Aug 21, 2024
1 parent 6fd5393 commit cbe7338
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,7 @@ macro_rules! int_impl {
///
/// Basic usage:
/// ```
/// #![feature(unbounded_shifts)]
#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(4), 0x10);")]
#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(129), 0);")]
/// ```
Expand Down Expand Up @@ -1447,10 +1448,11 @@ macro_rules! int_impl {
///
/// Basic usage:
/// ```
/// #![feature(unbounded_shifts)]
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shl(4), 0x1);")]
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shr(129), 0);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.unbounded_shr(129), -1);")]
/// ```
/// ```
#[unstable(feature = "unbounded_shifts", issue = "129375")]
#[rustc_allow_const_fn_unstable(unchecked_shifts)]
#[must_use = "this returns the result of the operation, \
Expand Down
4 changes: 3 additions & 1 deletion core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ macro_rules! uint_impl {
}
}

/// Unbounded shift left. Computes `self << rhs`, without bounding the value of `rhs`
/// Unbounded shift left. Computes `self << rhs`, without bounding the value of `rhs`
///
/// If `rhs` is larger or equal to the number of bits in `self`,
/// the entire value is shifted out, and `0` is returned.
Expand All @@ -1510,6 +1510,7 @@ macro_rules! uint_impl {
///
/// Basic usage:
/// ```
/// #![feature(unbounded_shifts)]
#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(4), 0x10);")]
#[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(129), 0);")]
/// ```
Expand Down Expand Up @@ -1635,6 +1636,7 @@ macro_rules! uint_impl {
///
/// Basic usage:
/// ```
/// #![feature(unbounded_shifts)]
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shr(4), 0x10);")]
#[doc = concat!("assert_eq!(0x10", stringify!($SelfT), ".unbounded_shr(129), 0);")]
/// ```
Expand Down

0 comments on commit cbe7338

Please sign in to comment.