Skip to content

Commit

Permalink
Rollup merge of #126904 - GrigorenkoPV:nonzero-fixme, r=joboet
Browse files Browse the repository at this point in the history
Small fixme in core now that NonZero is generic

I doubt I have the rights to, but
`@bors` rollup=always
  • Loading branch information
compiler-errors authored Jun 24, 2024
2 parents a7721a0 + 84474a2 commit 85eb835
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
8 changes: 0 additions & 8 deletions library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ impl u8 {
Self = u8,
ActualT = u8,
SignedT = i8,
NonZeroT = NonZero<u8>,
BITS = 8,
MAX = 255,
rot = 2,
Expand Down Expand Up @@ -1098,7 +1097,6 @@ impl u16 {
Self = u16,
ActualT = u16,
SignedT = i16,
NonZeroT = NonZero<u16>,
BITS = 16,
MAX = 65535,
rot = 4,
Expand Down Expand Up @@ -1147,7 +1145,6 @@ impl u32 {
Self = u32,
ActualT = u32,
SignedT = i32,
NonZeroT = NonZero<u32>,
BITS = 32,
MAX = 4294967295,
rot = 8,
Expand All @@ -1171,7 +1168,6 @@ impl u64 {
Self = u64,
ActualT = u64,
SignedT = i64,
NonZeroT = NonZero<u64>,
BITS = 64,
MAX = 18446744073709551615,
rot = 12,
Expand All @@ -1195,7 +1191,6 @@ impl u128 {
Self = u128,
ActualT = u128,
SignedT = i128,
NonZeroT = NonZero<u128>,
BITS = 128,
MAX = 340282366920938463463374607431768211455,
rot = 16,
Expand All @@ -1221,7 +1216,6 @@ impl usize {
Self = usize,
ActualT = u16,
SignedT = isize,
NonZeroT = NonZero<usize>,
BITS = 16,
MAX = 65535,
rot = 4,
Expand All @@ -1246,7 +1240,6 @@ impl usize {
Self = usize,
ActualT = u32,
SignedT = isize,
NonZeroT = NonZero<usize>,
BITS = 32,
MAX = 4294967295,
rot = 8,
Expand All @@ -1271,7 +1264,6 @@ impl usize {
Self = usize,
ActualT = u64,
SignedT = isize,
NonZeroT = NonZero<usize>,
BITS = 64,
MAX = 18446744073709551615,
rot = 12,
Expand Down
7 changes: 2 additions & 5 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ macro_rules! uint_impl {
Self = $SelfT:ty,
ActualT = $ActualT:ident,
SignedT = $SignedT:ident,
NonZeroT = $NonZeroT:ty,

// There are all for use *only* in doc comments.
// As such, they're all passed as literals -- passing them as a string
Expand Down Expand Up @@ -1216,8 +1215,7 @@ macro_rules! uint_impl {
without modifying the original"]
#[inline]
pub const fn checked_ilog2(self) -> Option<u32> {
// FIXME: Simply use `NonZero::new` once it is actually generic.
if let Some(x) = <$NonZeroT>::new(self) {
if let Some(x) = NonZero::new(self) {
Some(x.ilog2())
} else {
None
Expand All @@ -1239,8 +1237,7 @@ macro_rules! uint_impl {
without modifying the original"]
#[inline]
pub const fn checked_ilog10(self) -> Option<u32> {
// FIXME: Simply use `NonZero::new` once it is actually generic.
if let Some(x) = <$NonZeroT>::new(self) {
if let Some(x) = NonZero::new(self) {
Some(x.ilog10())
} else {
None
Expand Down

0 comments on commit 85eb835

Please sign in to comment.