Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixme in core now that NonZero is generic #126904

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading