Skip to content

Commit 808b848

Browse files
brsonalexcrichton
authored andcommitted
std: Add stability attributes to primitive numeric modules
The following are unstable: - core::int, i8, i16, i32, i64 - core::uint, u8, u16, u32, u64 - core::int::{BITS, BYTES, MIN, MAX}, etc. - std::int, i8, i16, i32, i64 - std::uint, u8, u16, u32, u64 The following are experimental: - std::from_str::FromStr and impls - may need to return Result instead of Option - std::int::parse_bytes, etc. - ditto - std::num::FromStrRadix and impls - ditto - std::num::from_str_radix - ditto The following are deprecated: - std::num::ToStrRadix and imples - Wrapper around fmt::radix. Wrong name (Str vs String) See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#uint
1 parent 250e236 commit 808b848

27 files changed

+44
-0
lines changed

src/libcore/num/i16.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for signed 16-bits integers (`i16` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "i16")]
1415

1516
int_module!(i16, 16)

src/libcore/num/i32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for signed 32-bits integers (`i32` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "i32")]
1415

1516
int_module!(i32, 32)

src/libcore/num/i64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for signed 64-bits integers (`i64` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "i64")]
1415

1516
int_module!(i64, 64)

src/libcore/num/i8.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for signed 8-bits integers (`i8` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "i8")]
1415

1516
int_module!(i8, 8)

src/libcore/num/int.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for architecture-sized signed integers (`int` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "int")]
1415

1516
#[cfg(target_word_size = "32")] int_module!(int, 32)

src/libcore/num/int_macros.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@ macro_rules! int_module (($T:ty, $bits:expr) => (
1515

1616
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
1717
// calling the `mem::size_of` function.
18+
#[unstable]
1819
pub static BITS : uint = $bits;
1920
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
2021
// calling the `mem::size_of` function.
22+
#[unstable]
2123
pub static BYTES : uint = ($bits / 8);
2224

2325
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
2426
// calling the `Bounded::min_value` function.
27+
#[unstable]
2528
pub static MIN: $T = (-1 as $T) << (BITS - 1);
2629
// FIXME(#9837): Compute MIN like this so the high bits that shouldn't exist are 0.
2730
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
2831
// calling the `Bounded::max_value` function.
32+
#[unstable]
2933
pub static MAX: $T = !MIN;
3034

3135
#[cfg(test)]

src/libcore/num/u16.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for unsigned 16-bits integers (`u16` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "u16")]
1415

1516
uint_module!(u16, i16, 16)

src/libcore/num/u32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for unsigned 32-bits integers (`u32` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "u32")]
1415

1516
uint_module!(u32, i32, 32)

src/libcore/num/u64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for unsigned 64-bits integer (`u64` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "u64")]
1415

1516
uint_module!(u64, i64, 64)

src/libcore/num/u8.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Operations and constants for unsigned 8-bits integers (`u8` type)
1212
13+
#![unstable]
1314
#![doc(primitive = "u8")]
1415

1516
uint_module!(u8, i8, 8)

0 commit comments

Comments
 (0)