Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize integer modules #20062

Merged
merged 1 commit into from
Dec 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/libcore/num/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

5 changes: 2 additions & 3 deletions src/libcore/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

) }

3 changes: 1 addition & 2 deletions src/libcore/num/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

5 changes: 2 additions & 3 deletions src/libcore/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

) }

2 changes: 1 addition & 1 deletion src/libstd/num/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/num/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down