diff options
| author | bors <bors@rust-lang.org> | 2014-05-28 12:41:40 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-28 12:41:40 -0700 |
| commit | e865415c2fe2c0e83fe1955238db082a1374c380 (patch) | |
| tree | 0e0ab6993ac13addc61cef0e3c8ffd0b5a09725a /src/libcore/char.rs | |
| parent | 98c2b4b4ac7a110aee7c236f5d5c392dc7617a03 (diff) | |
| parent | dd0d495f50e2d8ba501e6b003cb4c1ef52d95ed5 (diff) | |
auto merge of #14464 : Sawyer47/rust/issue-12925, r=alexcrichton
This is an attempt of fixing #12925. This PR moves almost all trait implementations for primitive types ((), bool, char, i*, u*, f*) near trait definitions. Only Float trait implementations weren't moved because they heavily rely on constants defined in f32.rs and f64.rs. Some trait implementations had cfg(not(test)) attribute. I suspect it's because of issue 2912. Still, someone who knows the problem better should probably check this code. Closes #12925
Diffstat (limited to 'src/libcore/char.rs')
| -rw-r--r-- | src/libcore/char.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 224f4ce1994..0c5d3151af0 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -34,9 +34,6 @@ pub use unicode::normalization::decompose_canonical; /// Returns the compatibility decomposition of a character. pub use unicode::normalization::decompose_compatible; -#[cfg(not(test))] use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering}; -#[cfg(not(test))] use default::Default; - // UTF-8 ranges and tags for encoding characters static TAG_CONT: u8 = 0b1000_0000u8; static TAG_TWO_B: u8 = 0b1100_0000u8; @@ -601,33 +598,6 @@ impl Char for char { } } -#[cfg(not(test))] -impl Eq for char { - #[inline] - fn eq(&self, other: &char) -> bool { (*self) == (*other) } -} - -#[cfg(not(test))] -impl TotalEq for char {} - -#[cfg(not(test))] -impl Ord for char { - #[inline] - fn lt(&self, other: &char) -> bool { *self < *other } -} - -#[cfg(not(test))] -impl TotalOrd for char { - fn cmp(&self, other: &char) -> Ordering { - (*self as u32).cmp(&(*other as u32)) - } -} - -#[cfg(not(test))] -impl Default for char { - #[inline] - fn default() -> char { '\x00' } -} #[cfg(test)] mod test { |
