Skip to content

Commit 84f779c

Browse files
authored
Rollup merge of rust-lang#78788 - jhpratt:isize-impl-fix, r=m-ou-se
Correct unsigned equivalent of isize to be usize See [rust-lang#74913 (comment)](rust-lang#74913 (comment)) for why this matters. Apparently it hasn't been used anywhere else, though CI will tell for sure.
2 parents 3f35770 + 8078474 commit 84f779c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/num/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ impl i128 {
130130
#[cfg(target_pointer_width = "16")]
131131
#[lang = "isize"]
132132
impl isize {
133-
int_impl! { isize, i16, u16, 16, -32768, 32767, "", "", 4, "-0x5ffd", "0x3a", "0x1234",
133+
int_impl! { isize, i16, usize, 16, -32768, 32767, "", "", 4, "-0x5ffd", "0x3a", "0x1234",
134134
"0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]",
135135
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
136136
}
137137

138138
#[cfg(target_pointer_width = "32")]
139139
#[lang = "isize"]
140140
impl isize {
141-
int_impl! { isize, i32, u32, 32, -2147483648, 2147483647, "", "", 8, "0x10000b3", "0xb301",
141+
int_impl! { isize, i32, usize, 32, -2147483648, 2147483647, "", "", 8, "0x10000b3", "0xb301",
142142
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
143143
"[0x12, 0x34, 0x56, 0x78]",
144144
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
@@ -147,7 +147,7 @@ impl isize {
147147
#[cfg(target_pointer_width = "64")]
148148
#[lang = "isize"]
149149
impl isize {
150-
int_impl! { isize, i64, u64, 64, -9223372036854775808, 9223372036854775807, "", "",
150+
int_impl! { isize, i64, usize, 64, -9223372036854775808, 9223372036854775807, "", "",
151151
12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
152152
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
153153
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",

0 commit comments

Comments
 (0)