Skip to content

Commit 5825c72

Browse files
committed
Change the type of constants BYTES/BITS to usize
1 parent f55d03c commit 5825c72

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libcore/num/int_macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ macro_rules! int_module { ($T:ty, $bits:expr) => (
1515
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
1616
// calling the `mem::size_of` function.
1717
#[unstable(feature = "core")]
18-
pub const BITS : u32 = $bits;
18+
pub const BITS : usize = $bits;
1919
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
2020
// calling the `mem::size_of` function.
2121
#[unstable(feature = "core")]
22-
pub const BYTES : u32 = ($bits / 8);
22+
pub const BYTES : usize = ($bits / 8);
2323

2424
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
2525
// calling the `Bounded::min_value` function.

src/libcore/num/uint_macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
macro_rules! uint_module { ($T:ty, $T_SIGNED:ty, $bits:expr) => (
1414

1515
#[unstable(feature = "core")]
16-
pub const BITS : u32 = $bits;
16+
pub const BITS : usize = $bits;
1717
#[unstable(feature = "core")]
18-
pub const BYTES : u32 = ($bits / 8);
18+
pub const BYTES : usize = ($bits / 8);
1919

2020
#[stable(feature = "rust1", since = "1.0.0")]
2121
pub const MIN: $T = 0 as $T;

0 commit comments

Comments
 (0)