Skip to content

Commit 85eb835

Browse files
Rollup merge of #126904 - GrigorenkoPV:nonzero-fixme, r=joboet
Small fixme in core now that NonZero is generic I doubt I have the rights to, but `@bors` rollup=always
2 parents a7721a0 + 84474a2 commit 85eb835

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

library/core/src/num/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ impl u8 {
483483
Self = u8,
484484
ActualT = u8,
485485
SignedT = i8,
486-
NonZeroT = NonZero<u8>,
487486
BITS = 8,
488487
MAX = 255,
489488
rot = 2,
@@ -1098,7 +1097,6 @@ impl u16 {
10981097
Self = u16,
10991098
ActualT = u16,
11001099
SignedT = i16,
1101-
NonZeroT = NonZero<u16>,
11021100
BITS = 16,
11031101
MAX = 65535,
11041102
rot = 4,
@@ -1147,7 +1145,6 @@ impl u32 {
11471145
Self = u32,
11481146
ActualT = u32,
11491147
SignedT = i32,
1150-
NonZeroT = NonZero<u32>,
11511148
BITS = 32,
11521149
MAX = 4294967295,
11531150
rot = 8,
@@ -1171,7 +1168,6 @@ impl u64 {
11711168
Self = u64,
11721169
ActualT = u64,
11731170
SignedT = i64,
1174-
NonZeroT = NonZero<u64>,
11751171
BITS = 64,
11761172
MAX = 18446744073709551615,
11771173
rot = 12,
@@ -1195,7 +1191,6 @@ impl u128 {
11951191
Self = u128,
11961192
ActualT = u128,
11971193
SignedT = i128,
1198-
NonZeroT = NonZero<u128>,
11991194
BITS = 128,
12001195
MAX = 340282366920938463463374607431768211455,
12011196
rot = 16,
@@ -1221,7 +1216,6 @@ impl usize {
12211216
Self = usize,
12221217
ActualT = u16,
12231218
SignedT = isize,
1224-
NonZeroT = NonZero<usize>,
12251219
BITS = 16,
12261220
MAX = 65535,
12271221
rot = 4,
@@ -1246,7 +1240,6 @@ impl usize {
12461240
Self = usize,
12471241
ActualT = u32,
12481242
SignedT = isize,
1249-
NonZeroT = NonZero<usize>,
12501243
BITS = 32,
12511244
MAX = 4294967295,
12521245
rot = 8,
@@ -1271,7 +1264,6 @@ impl usize {
12711264
Self = usize,
12721265
ActualT = u64,
12731266
SignedT = isize,
1274-
NonZeroT = NonZero<usize>,
12751267
BITS = 64,
12761268
MAX = 18446744073709551615,
12771269
rot = 12,

library/core/src/num/uint_macros.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ macro_rules! uint_impl {
33
Self = $SelfT:ty,
44
ActualT = $ActualT:ident,
55
SignedT = $SignedT:ident,
6-
NonZeroT = $NonZeroT:ty,
76

87
// There are all for use *only* in doc comments.
98
// As such, they're all passed as literals -- passing them as a string
@@ -1216,8 +1215,7 @@ macro_rules! uint_impl {
12161215
without modifying the original"]
12171216
#[inline]
12181217
pub const fn checked_ilog2(self) -> Option<u32> {
1219-
// FIXME: Simply use `NonZero::new` once it is actually generic.
1220-
if let Some(x) = <$NonZeroT>::new(self) {
1218+
if let Some(x) = NonZero::new(self) {
12211219
Some(x.ilog2())
12221220
} else {
12231221
None
@@ -1239,8 +1237,7 @@ macro_rules! uint_impl {
12391237
without modifying the original"]
12401238
#[inline]
12411239
pub const fn checked_ilog10(self) -> Option<u32> {
1242-
// FIXME: Simply use `NonZero::new` once it is actually generic.
1243-
if let Some(x) = <$NonZeroT>::new(self) {
1240+
if let Some(x) = NonZero::new(self) {
12441241
Some(x.ilog10())
12451242
} else {
12461243
None

0 commit comments

Comments
 (0)