2014-04-30 22:23:26 -07:00
|
|
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
#![macro_escape]
|
|
|
|
#![doc(hidden)]
|
|
|
|
|
2014-11-14 09:18:10 -08:00
|
|
|
macro_rules! uint_module { ($T:ty, $T_SIGNED:ty, $bits:expr) => (
|
2014-04-30 22:23:26 -07:00
|
|
|
|
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
2014-06-23 23:44:41 +00:00
|
|
|
#[unstable]
|
2014-10-06 16:14:00 -07:00
|
|
|
pub const BITS : uint = $bits;
|
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
2014-06-23 23:44:41 +00:00
|
|
|
#[unstable]
|
2014-10-06 16:14:00 -07:00
|
|
|
pub const BYTES : uint = ($bits / 8);
|
2014-04-30 22:23:26 -07:00
|
|
|
|
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
2014-06-23 23:44:41 +00:00
|
|
|
#[unstable]
|
2014-10-06 16:14:00 -07:00
|
|
|
pub const MIN: $T = 0 as $T;
|
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
2014-06-23 23:44:41 +00:00
|
|
|
#[unstable]
|
2014-10-06 16:14:00 -07:00
|
|
|
pub const MAX: $T = 0 as $T - 1 as $T;
|
2014-04-30 22:23:26 -07:00
|
|
|
|
2014-11-14 09:18:10 -08:00
|
|
|
) }
|
|
|
|
|