]> git.lizzy.rs Git - rust.git/commitdiff
std: Clean up primitive integer modules
authorAlex Crichton <alex@alexcrichton.com>
Mon, 17 Aug 2015 20:23:36 +0000 (13:23 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 17 Aug 2015 21:03:32 +0000 (14:03 -0700)
All of the modules in the standard library were just straight reexports of those
in libcore, so remove all the "macro modules" from the standard library and just
reexport what's in core directly.

26 files changed:
src/libcore/num/i16.rs
src/libcore/num/i32.rs
src/libcore/num/i64.rs
src/libcore/num/i8.rs
src/libcore/num/isize.rs
src/libcore/num/u16.rs
src/libcore/num/u32.rs
src/libcore/num/u64.rs
src/libcore/num/u8.rs
src/libcore/num/usize.rs
src/libcoretest/num/uint_macros.rs
src/libstd/lib.rs
src/libstd/macros.rs
src/libstd/num/float_macros.rs [deleted file]
src/libstd/num/i16.rs [deleted file]
src/libstd/num/i32.rs [deleted file]
src/libstd/num/i64.rs [deleted file]
src/libstd/num/i8.rs [deleted file]
src/libstd/num/int_macros.rs [deleted file]
src/libstd/num/isize.rs [deleted file]
src/libstd/num/u16.rs [deleted file]
src/libstd/num/u32.rs [deleted file]
src/libstd/num/u64.rs [deleted file]
src/libstd/num/u8.rs [deleted file]
src/libstd/num/uint_macros.rs [deleted file]
src/libstd/num/usize.rs [deleted file]

index dacb4ebcdfa3ae7be74a19f0f9b38b0bd22f0174..4054497941797140ccc4fa1c9d7c8496e8efe446 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for signed 16-bits integers (`i16` type)
+//! The 16-bit signed integer type.
+//!
+//! *[See also the `i16` primitive type](../primitive.i16.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index 250d66de70b345fcd8e99e36ece5adf7456e1c03..5d2ade8d8e0e93b3dcd0e0adb539e48a9391a8e3 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for signed 32-bits integers (`i32` type)
+//! The 32-bit signed integer type.
+//!
+//! *[See also the `i32` primitive type](../primitive.i32.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index 5ed21d7246cd0385202dddbfdb49c22c2a26bf6d..b1d43a3b83872a79b2dd55de5c2ca2e0276674c9 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for signed 64-bits integers (`i64` type)
+//! The 64-bit signed integer type.
+//!
+//! *[See also the `i64` primitive type](../primitive.i64.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index 0394c12d5c45790cf382b32a12be3d59741d629e..ee003d92b28235c47e366624cd6410722faa0548 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for signed 8-bits integers (`i8` type)
+//! The 8-bit signed integer type.
+//!
+//! *[See also the `i8` primitive type](../primitive.i8.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index 066cb10cce265bc45262ffe7994f0afc9b9f52a6..034a5c0eb89d4388c16be66883a5baff71bf84c8 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for pointer-sized signed integers (`isize` type)
+//! The pointer-sized signed integer type.
+//!
+//! *[See also the `isize` primitive type](../primitive.isize.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index ecf799448483c6987b6c9d690342a5a7b730e762..68e50e8a400ea021a472b0542c64509c7eaa976c 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for unsigned 16-bits integers (`u16` type)
+//! The 16-bit unsigned integer type.
+//!
+//! *[See also the `u16` primitive type](../primitive.u16.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index b0682b55ac05da0fd8799e6094b57b3fee9ce71a..c1ee96b363c27783e016f113c6a59b54e0a3f651 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for unsigned 32-bits integers (`u32` type)
+//! The 32-bit unsigned integer type.
+//!
+//! *[See also the `u32` primitive type](../primitive.u32.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index dbc6a64a905d26576a9f16ce99ec6bbe11fb4ab8..c0d18d850a796d9a841c17f85c448a42f5becb47 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for unsigned 64-bits integer (`u64` type)
+//! The 64-bit unsigned integer type.
+//!
+//! *[See also the `u64` primitive type](../primitive.u64.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index bf9347ca62c920884bce48c121904e8698c91395..a60c480d810ea4e20be74b5add6271c9e95c7760 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for unsigned 8-bits integers (`u8` type)
+//! The 8-bit unsigned integer type.
+//!
+//! *[See also the `u8` primitive type](../primitive.u8.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index 67e3c954ab695bb7bbf5089aa939416dc668bb48..70e790106e1c6706e4e96f8cb9ce4a858fae2201 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations and constants for pointer-sized unsigned integers (`usize` type)
+//! The pointer-sized unsigned integer type.
+//!
+//! *[See also the `usize` primitive type](../primitive.usize.html).*
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
index 1712345f9d9a7c8316b04f1e8e85e3980873a0fd..6238c6d43e353e033b3ee54314518e9fe38ee5ab 100644 (file)
@@ -14,6 +14,7 @@ mod tests {
     use core::$T_i::*;
     use num;
     use core::ops::{BitOr, BitAnd, BitXor, Shl, Shr, Not};
+    use std::str;
 
     #[test]
     fn test_overflows() {
@@ -121,6 +122,35 @@ fn test_unsigned_checked_div() {
         assert!((10 as $T).checked_div(2) == Some(5));
         assert!((5 as $T).checked_div(0) == None);
     }
-}
+
+    fn from_str<T: FromStr>(t: &str) -> Option<T> {
+        FromStr::from_str(t).ok()
+    }
+
+    #[test]
+    pub fn test_from_str() {
+        assert_eq!(from_str::<$T>("0"), Some(0 as $T));
+        assert_eq!(from_str::<$T>("3"), Some(3 as $T));
+        assert_eq!(from_str::<$T>("10"), Some(10 as $T));
+        assert_eq!(from_str::<u32>("123456789"), Some(123456789 as u32));
+        assert_eq!(from_str::<$T>("00100"), Some(100 as $T));
+
+        assert_eq!(from_str::<$T>(""), None);
+        assert_eq!(from_str::<$T>(" "), None);
+        assert_eq!(from_str::<$T>("x"), None);
+    }
+
+    #[test]
+    pub fn test_parse_bytes() {
+        assert_eq!($T::from_str_radix("123", 10), Ok(123 as $T));
+        assert_eq!($T::from_str_radix("1001", 2), Ok(9 as $T));
+        assert_eq!($T::from_str_radix("123", 8), Ok(83 as $T));
+        assert_eq!(u16::from_str_radix("123", 16), Ok(291 as u16));
+        assert_eq!(u16::from_str_radix("ffff", 16), Ok(65535 as u16));
+        assert_eq!($T::from_str_radix("z", 36), Ok(35 as $T));
+
+        assert_eq!($T::from_str_radix("Z", 10).ok(), None::<$T>);
+        assert_eq!($T::from_str_radix("_", 2).ok(), None::<$T>);
+    }
 
 )}
index 655fa04c2644ee51022ed00f0f8ca08e7d5abd96..8fed380a5b46865cc808a4ef7289a0c31c642ddb 100644 (file)
 // Don't link to std. We are std.
 #![no_std]
 
-#![allow(trivial_casts)]
 #![deny(missing_docs)]
 
 #[cfg(test)] extern crate test;
 // imported by the compiler (via our #[no_std] attribute) In this case we just
 // add a new crate name so we can attach the reexports to it.
 #[macro_reexport(assert, assert_eq, debug_assert, debug_assert_eq,
-    unreachable, unimplemented, write, writeln)]
+                 unreachable, unimplemented, write, writeln)]
 extern crate core as __core;
 
 #[macro_use]
 pub use core_collections::slice;
 pub use core_collections::str;
 pub use core_collections::string;
-#[stable(feature = "rust1", since = "1.0.0")]
 pub use core_collections::vec;
 
 pub use rustc_unicode::char;
 
 /* Primitive types */
 
-// NB: slice and str are primitive types too, but their module docs + primitive doc pages
-// are inlined from the public re-exports of core_collections::{slice, str} above.
-
-#[path = "num/float_macros.rs"]
-#[macro_use]
-mod float_macros;
-
-#[path = "num/int_macros.rs"]
-#[macro_use]
-mod int_macros;
-
-#[path = "num/uint_macros.rs"]
-#[macro_use]
-mod uint_macros;
-
-#[path = "num/isize.rs"]  pub mod isize;
-#[path = "num/i8.rs"]   pub mod i8;
-#[path = "num/i16.rs"]  pub mod i16;
-#[path = "num/i32.rs"]  pub mod i32;
-#[path = "num/i64.rs"]  pub mod i64;
-
-#[path = "num/usize.rs"] pub mod usize;
-#[path = "num/u8.rs"]   pub mod u8;
-#[path = "num/u16.rs"]  pub mod u16;
-#[path = "num/u32.rs"]  pub mod u32;
-#[path = "num/u64.rs"]  pub mod u64;
+// NB: slice and str are primitive types too, but their module docs + primitive
+// doc pages are inlined from the public re-exports of core_collections::{slice,
+// str} above.
+
+pub use core::isize;
+pub use core::i8;
+pub use core::i16;
+pub use core::i32;
+pub use core::i64;
+
+pub use core::usize;
+pub use core::u8;
+pub use core::u16;
+pub use core::u32;
+pub use core::u64;
 
 #[path = "num/f32.rs"]   pub mod f32;
 #[path = "num/f64.rs"]   pub mod f64;
index eb378bf408028241dfb53557a6d599dc088f4d40..53a14c2b21b174c8a7ef728c5a7290e86c80dbfa 100644 (file)
@@ -197,6 +197,15 @@ macro_rules! log {
     )
 }
 
+#[cfg(test)]
+macro_rules! assert_approx_eq {
+    ($a:expr, $b:expr) => ({
+        let (a, b) = (&$a, &$b);
+        assert!((*a - *b).abs() < 1.0e-6,
+                "{} is not approximately equal to {}", *a, *b);
+    })
+}
+
 /// Built-in macros to the compiler itself.
 ///
 /// These macros do not have any corresponding definition with a `macro_rules!`
diff --git a/src/libstd/num/float_macros.rs b/src/libstd/num/float_macros.rs
deleted file mode 100644 (file)
index 16ad21a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 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.
-
-#![doc(hidden)]
-
-macro_rules! assert_approx_eq {
-    ($a:expr, $b:expr) => ({
-        let (a, b) = (&$a, &$b);
-        assert!((*a - *b).abs() < 1.0e-6,
-                "{} is not approximately equal to {}", *a, *b);
-    })
-}
diff --git a/src/libstd/num/i16.rs b/src/libstd/num/i16.rs
deleted file mode 100644 (file)
index eb53e08..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 16-bit signed integer type.
-//!
-//! *[See also the `i16` primitive type](../primitive.i16.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::i16::{BITS, BYTES, MIN, MAX};
-
-int_module! { i16 }
diff --git a/src/libstd/num/i32.rs b/src/libstd/num/i32.rs
deleted file mode 100644 (file)
index 3c9eedf..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 32-bit signed integer type.
-//!
-//! *[See also the `i32` primitive type](../primitive.i32.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::i32::{BITS, BYTES, MIN, MAX};
-
-int_module! { i32 }
diff --git a/src/libstd/num/i64.rs b/src/libstd/num/i64.rs
deleted file mode 100644 (file)
index 2df7478..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 64-bit signed integer type.
-//!
-//! *[See also the `i64` primitive type](../primitive.i64.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::i64::{BITS, BYTES, MIN, MAX};
-
-int_module! { i64 }
diff --git a/src/libstd/num/i8.rs b/src/libstd/num/i8.rs
deleted file mode 100644 (file)
index 4e4bee8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 8-bit signed integer type.
-//!
-//! *[See also the `i8` primitive type](../primitive.i8.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::i8::{BITS, BYTES, MIN, MAX};
-
-int_module! { i8 }
diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs
deleted file mode 100644 (file)
index 178fad0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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.
-
-#![doc(hidden)]
-
-macro_rules! int_module { ($T:ty) => (
-
-) }
diff --git a/src/libstd/num/isize.rs b/src/libstd/num/isize.rs
deleted file mode 100644 (file)
index d46b6b8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012-2015 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.
-
-//! The pointer-sized signed integer type.
-//!
-//! *[See also the `isize` primitive type](../primitive.isize.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::isize::{BITS, BYTES, MIN, MAX};
-
-int_module! { isize }
diff --git a/src/libstd/num/u16.rs b/src/libstd/num/u16.rs
deleted file mode 100644 (file)
index 893618a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 16-bit unsigned integer type.
-//!
-//! *[See also the `u16` primitive type](../primitive.u16.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::u16::{BITS, BYTES, MIN, MAX};
-
-uint_module! { u16 }
diff --git a/src/libstd/num/u32.rs b/src/libstd/num/u32.rs
deleted file mode 100644 (file)
index 2da2551..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 32-bit unsigned integer type.
-//!
-//! *[See also the `u32` primitive type](../primitive.u32.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::u32::{BITS, BYTES, MIN, MAX};
-
-uint_module! { u32 }
diff --git a/src/libstd/num/u64.rs b/src/libstd/num/u64.rs
deleted file mode 100644 (file)
index 26a8b53..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 64-bit unsigned integer type.
-//!
-//! *[See also the `u64` primitive type](../primitive.u64.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::u64::{BITS, BYTES, MIN, MAX};
-
-uint_module! { u64 }
diff --git a/src/libstd/num/u8.rs b/src/libstd/num/u8.rs
deleted file mode 100644 (file)
index 385754b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 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.
-
-//! The 8-bit unsigned integer type.
-//!
-//! *[See also the `u8` primitive type](../primitive.u8.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::u8::{BITS, BYTES, MIN, MAX};
-
-uint_module! { u8 }
diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs
deleted file mode 100644 (file)
index 902c78c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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.
-
-#![doc(hidden)]
-
-macro_rules! uint_module { ($T:ident) => (
-
-#[cfg(test)]
-mod tests {
-    use prelude::v1::*;
-
-    fn from_str<T: ::str::FromStr>(t: &str) -> Option<T> {
-        ::str::FromStr::from_str(t).ok()
-    }
-
-    #[test]
-    pub fn test_from_str() {
-        assert_eq!(from_str::<$T>("0"), Some(0 as $T));
-        assert_eq!(from_str::<$T>("3"), Some(3 as $T));
-        assert_eq!(from_str::<$T>("10"), Some(10 as $T));
-        assert_eq!(from_str::<u32>("123456789"), Some(123456789 as u32));
-        assert_eq!(from_str::<$T>("00100"), Some(100 as $T));
-
-        assert_eq!(from_str::<$T>(""), None);
-        assert_eq!(from_str::<$T>(" "), None);
-        assert_eq!(from_str::<$T>("x"), None);
-    }
-
-    #[test]
-    pub fn test_parse_bytes() {
-        assert_eq!($T::from_str_radix("123", 10), Ok(123 as $T));
-        assert_eq!($T::from_str_radix("1001", 2), Ok(9 as $T));
-        assert_eq!($T::from_str_radix("123", 8), Ok(83 as $T));
-        assert_eq!(u16::from_str_radix("123", 16), Ok(291 as u16));
-        assert_eq!(u16::from_str_radix("ffff", 16), Ok(65535 as u16));
-        assert_eq!($T::from_str_radix("z", 36), Ok(35 as $T));
-
-        assert_eq!($T::from_str_radix("Z", 10).ok(), None::<$T>);
-        assert_eq!($T::from_str_radix("_", 2).ok(), None::<$T>);
-    }
-}
-
-) }
diff --git a/src/libstd/num/usize.rs b/src/libstd/num/usize.rs
deleted file mode 100644 (file)
index 6960ba3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012-2015 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.
-
-//! The pointer-sized unsigned integer type.
-//!
-//! *[See also the `usize` primitive type](../primitive.usize.html).*
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-pub use core::usize::{BITS, BYTES, MIN, MAX};
-
-uint_module! { usize }