diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-10 16:26:10 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-13 03:46:03 +1100 |
| commit | e965ba85ca689ad77f63b7f0af9d7e337dcb4825 (patch) | |
| tree | 0ecf2223970c18455595e523ca594fe6d3321129 /src/libcore/num | |
| parent | 891559e30d045606aa109f4991074f783a5e50f8 (diff) | |
| download | rust-e965ba85ca689ad77f63b7f0af9d7e337dcb4825.tar.gz rust-e965ba85ca689ad77f63b7f0af9d7e337dcb4825.zip | |
Remove lots of numeric traits from the preludes
Num, NumCast, Unsigned, Float, Primitive and Int have been removed.
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/f32.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/f64.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/mod.rs | 22 |
3 files changed, 26 insertions, 0 deletions
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index fddb41c38ef..5913b8d75a7 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -234,6 +234,8 @@ impl Float for f32 { /// The fractional part of the number, satisfying: /// /// ```rust + /// use core::num::Float; + /// /// let x = 1.65f32; /// assert!(x == x.trunc() + x.fract()) /// ``` diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index f06b7e97cf1..8f68578d768 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -240,6 +240,8 @@ impl Float for f64 { /// The fractional part of the number, satisfying: /// /// ```rust + /// use core::num::Float; + /// /// let x = 1.65f64; /// assert!(x == x.trunc() + x.fract()) /// ``` diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 6ec6839f0a0..dd2ee6e01c6 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -204,6 +204,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0b01001100u8; /// /// assert_eq!(n.count_ones(), 3); @@ -215,6 +217,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0b01001100u8; /// /// assert_eq!(n.count_zeros(), 5); @@ -230,6 +234,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0b0101000u16; /// /// assert_eq!(n.leading_zeros(), 10); @@ -242,6 +248,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0b0101000u16; /// /// assert_eq!(n.trailing_zeros(), 3); @@ -254,6 +262,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0x0123456789ABCDEFu64; /// let m = 0x3456789ABCDEF012u64; /// @@ -267,6 +277,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0x0123456789ABCDEFu64; /// let m = 0xDEF0123456789ABCu64; /// @@ -279,6 +291,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0x0123456789ABCDEFu64; /// let m = 0xEFCDAB8967452301u64; /// @@ -293,6 +307,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0x0123456789ABCDEFu64; /// /// if cfg!(target_endian = "big") { @@ -313,6 +329,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0x0123456789ABCDEFu64; /// /// if cfg!(target_endian = "little") { @@ -333,6 +351,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0x0123456789ABCDEFu64; /// /// if cfg!(target_endian = "big") { @@ -353,6 +373,8 @@ pub trait Int /// # Example /// /// ```rust + /// use std::num::Int; + /// /// let n = 0x0123456789ABCDEFu64; /// /// if cfg!(target_endian = "little") { |
