Skip to content

Commit faefa74

Browse files
committed
---
yaml --- r: 114680 b: refs/heads/auto c: 5592a8f h: refs/heads/master v: v3
1 parent b1d9365 commit faefa74

File tree

5 files changed

+16
-58
lines changed

5 files changed

+16
-58
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: b024ba544c8cf831423cdd24d2dc516d66dc6269
16+
refs/heads/auto: 5592a8f5db52a11b63547b661b3a635655b16980
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/cmp.rs renamed to branches/auto/src/libcore/cmp.rs

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,8 @@ pub trait TotalEq: Eq {
8181
fn assert_receiver_is_total_eq(&self) {}
8282
}
8383

84-
/// A macro which defines an implementation of TotalEq for a given type.
85-
macro_rules! totaleq_impl(
86-
($t:ty) => {
87-
impl TotalEq for $t {}
88-
}
89-
)
90-
91-
totaleq_impl!(bool)
92-
93-
totaleq_impl!(u8)
94-
totaleq_impl!(u16)
95-
totaleq_impl!(u32)
96-
totaleq_impl!(u64)
97-
98-
totaleq_impl!(i8)
99-
totaleq_impl!(i16)
100-
totaleq_impl!(i32)
101-
totaleq_impl!(i64)
102-
103-
totaleq_impl!(int)
104-
totaleq_impl!(uint)
105-
106-
totaleq_impl!(char)
107-
10884
/// An ordering is, e.g, a result of a comparison between two values.
109-
#[deriving(Clone, Eq, Show)]
85+
#[deriving(Clone, Eq)]
11086
pub enum Ordering {
11187
/// An ordering where a compared value is less [than another].
11288
Less = -1,
@@ -140,6 +116,7 @@ pub trait TotalOrd: TotalEq + Ord {
140116
}
141117

142118
impl TotalEq for Ordering {}
119+
143120
impl TotalOrd for Ordering {
144121
#[inline]
145122
fn cmp(&self, other: &Ordering) -> Ordering {
@@ -152,35 +129,6 @@ impl Ord for Ordering {
152129
fn lt(&self, other: &Ordering) -> bool { (*self as int) < (*other as int) }
153130
}
154131

155-
/// A macro which defines an implementation of TotalOrd for a given type.
156-
macro_rules! totalord_impl(
157-
($t:ty) => {
158-
impl TotalOrd for $t {
159-
#[inline]
160-
fn cmp(&self, other: &$t) -> Ordering {
161-
if *self < *other { Less }
162-
else if *self > *other { Greater }
163-
else { Equal }
164-
}
165-
}
166-
}
167-
)
168-
169-
totalord_impl!(u8)
170-
totalord_impl!(u16)
171-
totalord_impl!(u32)
172-
totalord_impl!(u64)
173-
174-
totalord_impl!(i8)
175-
totalord_impl!(i16)
176-
totalord_impl!(i32)
177-
totalord_impl!(i64)
178-
179-
totalord_impl!(int)
180-
totalord_impl!(uint)
181-
182-
totalord_impl!(char)
183-
184132
/// Combine orderings, lexically.
185133
///
186134
/// For example for a type `(int, int)`, two comparisons could be done.

branches/auto/src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub mod ptr;
3030

3131
/* Core language traits */
3232

33+
pub mod cmp;
3334
pub mod kinds;
3435
pub mod ops;
3536
pub mod ty;

branches/auto/src/libstd/fmt/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ will look like `"\\{"`.
486486
use any;
487487
use cast;
488488
use char::Char;
489+
use cmp;
489490
use container::Container;
490491
use io::MemWriter;
491492
use io;
@@ -1315,5 +1316,15 @@ impl<T: Show> Show for iter::MinMaxResult<T> {
13151316
}
13161317
}
13171318

1319+
impl Show for cmp::Ordering {
1320+
fn fmt(&self, f: &mut Formatter) -> Result {
1321+
match *self {
1322+
cmp::Less => write!(f.buf, "Less"),
1323+
cmp::Greater => write!(f.buf, "Greater"),
1324+
cmp::Equal => write!(f.buf, "Equal"),
1325+
}
1326+
}
1327+
}
1328+
13181329
// If you expected tests to be here, look instead at the run-pass/ifmt.rs test,
13191330
// it's a lot easier than creating all of the rt::Piece structures here.

branches/auto/src/libstd/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ extern crate core;
135135

136136
#[cfg(not(test))] pub use kinds = core::kinds;
137137
#[cfg(not(test))] pub use ops = core::ops;
138+
#[cfg(not(test))] pub use cmp = core::cmp;
138139
#[cfg(not(test))] pub use ty = core::ty;
139140

140141
pub use core::any;
@@ -207,13 +208,10 @@ mod reference;
207208
pub mod rc;
208209
pub mod gc;
209210

210-
211211
/* Core language traits */
212212

213-
#[cfg(not(test))] pub mod cmp;
214213
#[cfg(not(test))] pub mod owned;
215214

216-
217215
/* Common traits */
218216

219217
pub mod from_str;

0 commit comments

Comments
 (0)