Stabilize integer modules

This small patch stabilizes the names of all integer modules (including
`int` and `uint`) and the `MIN` and `MAX` constants. The `BITS` and
`BYTES` constants are left unstable for now.
This commit is contained in:
Aaron Turon 2014-12-19 22:28:12 -08:00
parent 1c2df5cc3c
commit 89f75a6e81
6 changed files with 8 additions and 12 deletions

View File

@ -10,9 +10,8 @@
//! Operations and constants for architecture-sized signed integers (`int` type)
#![unstable]
#![stable]
#![doc(primitive = "int")]
#[cfg(target_word_size = "32")] int_module! { int, 32 }
#[cfg(target_word_size = "64")] int_module! { int, 64 }

View File

@ -24,13 +24,12 @@ pub const BYTES : uint = ($bits / 8);
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
// calling the `Bounded::min_value` function.
#[unstable]
#[stable]
pub const MIN: $T = (-1 as $T) << (BITS - 1);
// FIXME(#9837): Compute MIN like this so the high bits that shouldn't exist are 0.
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
// calling the `Bounded::max_value` function.
#[unstable]
#[stable]
pub const MAX: $T = !MIN;
) }

View File

@ -10,8 +10,7 @@
//! Operations and constants for architecture-sized unsigned integers (`uint` type)
#![unstable]
#![stable]
#![doc(primitive = "uint")]
uint_module! { uint, int, ::int::BITS }

View File

@ -18,10 +18,9 @@ pub const BITS : uint = $bits;
#[unstable]
pub const BYTES : uint = ($bits / 8);
#[unstable]
#[stable]
pub const MIN: $T = 0 as $T;
#[unstable]
#[stable]
pub const MAX: $T = 0 as $T - 1 as $T;
) }

View File

@ -10,7 +10,7 @@
//! Operations and constants for architecture-sized signed integers (`int` type)
#![unstable]
#![stable]
#![doc(primitive = "int")]
pub use core::int::{BITS, BYTES, MIN, MAX};

View File

@ -10,7 +10,7 @@
//! Operations and constants for architecture-sized unsigned integers (`uint` type)
#![unstable]
#![stable]
#![doc(primitive = "uint")]
pub use core::uint::{BITS, BYTES, MIN, MAX};