Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1bd207e

Browse files
Rollup merge ofrust-lang#126904 - GrigorenkoPV:nonzero-fixme, r=joboet
Small fixme in core now that NonZero is genericI doubt I have the rights to, but`@bors` rollup=always
2 parents2676918 +532304b commit1bd207e

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

‎core/src/num/mod.rs‎

Lines changed: 0 additions & 8 deletions
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,

‎core/src/num/uint_macros.rs‎

Lines changed: 2 additions & 5 deletions
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
pubconstfn checked_ilog2(self) ->Option<u32>{
1219-
// FIXME: Simply use `NonZero::new` once it is actually generic.
1220-
ifletSome(x) = <$NonZeroT>::new(self){
1218+
ifletSome(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
pubconstfn checked_ilog10(self) ->Option<u32>{
1242-
// FIXME: Simply use `NonZero::new` once it is actually generic.
1243-
ifletSome(x) = <$NonZeroT>::new(self){
1240+
ifletSome(x) =NonZero::new(self){
12441241
Some(x.ilog10())
12451242
} else{
12461243
None

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp