diff options
| author | Connor Horman <chorman64@gmail.com> | 2024-08-21 23:22:07 +0000 |
|---|---|---|
| committer | Connor Horman <chorman64@gmail.com> | 2024-08-21 23:22:07 +0000 |
| commit | 9907f617ab8c0fc1a36161d5b33cd86780fb9b09 (patch) | |
| tree | 93a4643565fccad6d745fef8d19253be3da71491 | |
| parent | 79cbb878c7ca739b5136c9b87402860f017919d2 (diff) | |
fix(core): Add `#![feature(unbounded_shifts)]` to doctests for `unbounded_shr`/`unbounded_shl`
| -rw-r--r-- | library/core/src/num/int_macros.rs | 4 | ||||
| -rw-r--r-- | library/core/src/num/uint_macros.rs | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 8c4f6a37fa9..91d70473a66 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -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);")] /// ``` @@ -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, \ diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 643a76d23e4..161ee649c84 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -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. @@ -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);")] /// ``` @@ -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);")] /// ``` |
