Skip to content

Commit 9921e67

Browse files
committed
---
yaml --- r: 56439 b: refs/heads/auto c: ad0b337 h: refs/heads/master i: 56437: 5e31549 56435: 808bc5d 56431: 69dc448 v: v3
1 parent d23476c commit 9921e67

File tree

18 files changed

+1280
-427
lines changed

18 files changed

+1280
-427
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 6d589f88f79a987de61fce00f0364b4199f50c22
17+
refs/heads/auto: ad0b337036f2f9076852d5d6701ec302e3cce101
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/char.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Utilities for manipulating the char type
1212
13-
use cmp::Ord;
1413
use option::{None, Option, Some};
1514
use str;
1615
use u32;
@@ -244,26 +243,26 @@ pub fn len_utf8_bytes(c: char) -> uint {
244243
else { fail!(~"invalid character!") }
245244
}
246245
246+
/**
247+
* Compare two chars
248+
*
249+
* # Return value
250+
*
251+
* -1 if a < b, 0 if a == b, +1 if a > b
252+
*/
253+
#[inline(always)]
254+
pub fn cmp(a: char, b: char) -> int {
255+
return if b > a { -1 }
256+
else if b < a { 1 }
257+
else { 0 }
258+
}
259+
247260
#[cfg(notest)]
248261
impl Eq for char {
249-
#[inline(always)]
250262
fn eq(&self, other: &char) -> bool { (*self) == (*other) }
251-
#[inline(always)]
252263
fn ne(&self, other: &char) -> bool { (*self) != (*other) }
253264
}
254265
255-
#[cfg(notest)]
256-
impl Ord for char {
257-
#[inline(always)]
258-
fn lt(&self, other: &char) -> bool { *self < *other }
259-
#[inline(always)]
260-
fn le(&self, other: &char) -> bool { *self <= *other }
261-
#[inline(always)]
262-
fn gt(&self, other: &char) -> bool { *self > *other }
263-
#[inline(always)]
264-
fn ge(&self, other: &char) -> bool { *self >= *other }
265-
}
266-
267266
#[test]
268267
fn test_is_lowercase() {
269268
assert!(is_lowercase('a'));

branches/auto/src/libcore/cmp.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ totaleq_impl!(i64)
6464
totaleq_impl!(int)
6565
totaleq_impl!(uint)
6666

67-
totaleq_impl!(char)
68-
6967
#[deriving(Clone, Eq)]
7068
pub enum Ordering { Less = -1, Equal = 0, Greater = 1 }
7169

@@ -118,8 +116,6 @@ totalord_impl!(i64)
118116
totalord_impl!(int)
119117
totalord_impl!(uint)
120118

121-
totalord_impl!(char)
122-
123119
pub fn cmp2<A:TotalOrd,B:TotalOrd>(
124120
a1: &A, b1: &B,
125121
a2: &A, b2: &B) -> Ordering

branches/auto/src/libcore/core.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ pub use kinds::{Const, Copy, Owned, Durable};
7777
pub use ops::{Drop};
7878
#[cfg(stage0)]
7979
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
80-
#[cfg(stage1)]
81-
#[cfg(stage2)]
82-
#[cfg(stage3)]
80+
#[cfg(not(stage0))]
8381
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
8482
pub use ops::{BitAnd, BitOr, BitXor};
8583
pub use ops::{Shl, Shr, Index};
@@ -105,7 +103,9 @@ pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
105103
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
106104
pub use iter::{ExtendedMutableIter};
107105

108-
pub use num::{Num, Signed, Unsigned, Natural, NumCast};
106+
pub use num::{Num, NumCast};
107+
pub use num::{Signed, Unsigned, Integer};
108+
pub use num::{Round, Fractional, Real, RealExt};
109109
pub use ptr::Ptr;
110110
pub use to_str::ToStr;
111111
pub use clone::Clone;

0 commit comments

Comments
 (0)