Skip to content

Commit 9e44a61

Browse files
committed
---
yaml --- r: 143908 b: refs/heads/try2 c: 8b502d6 h: refs/heads/master v: v3
1 parent ca42078 commit 9e44a61

File tree

12 files changed

+95
-328
lines changed

12 files changed

+95
-328
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d9492d72baa73082be91edf8acd6bb97747db3c9
8+
refs/heads/try2: 8b502d60abf582e799aa7390cb9b8ab2b4465e65
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ opt docs 1 "build documentation"
371371
opt optimize 1 "build optimized rust code"
372372
opt optimize-cxx 1 "build optimized C++ code"
373373
opt optimize-llvm 1 "build optimized LLVM"
374-
opt optimize-tests 1 "build tests with optimizations"
375374
opt llvm-assertions 1 "build LLVM with assertions"
376375
opt debug 0 "build with extra debug fun"
377376
opt ratchet-bench 0 "ratchet benchmarks"

branches/try2/doc/rustpkg.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ When building a package that is in a `git` repository,
103103
When building a package that is not under version control,
104104
or that has no tags, `rustpkg` assumes the intended version is 0.1.
105105

106-
> **Note:** A future version of rustpkg will support semantic versions.
107-
> Also, a future version will add the option to specify a version with a metadata
108-
> attribute like `#[link(vers = "3.1415")]` inside the crate module,
109-
> though this attribute will never be mandatory.
110-
111106
# Dependencies
112107

113108
rustpkg infers dependencies from `extern mod` directives.

branches/try2/mk/tests.mk

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,15 +552,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
552552

553553
# The tests select when to use debug configuration on their own;
554554
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
555-
CTEST_RUSTC_FLAGS := $$(subst --cfg debug,,$$(CFG_RUSTC_FLAGS))
556-
557-
# The tests can not be optimized while the rest of the compiler is optimized, so
558-
# filter out the optimization (if any) from rustc and then figure out if we need
559-
# to be optimized
560-
CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
561-
ifndef CFG_DISABLE_OPTIMIZE_TESTS
562-
CTEST_RUSTC_FLAGS += -O
563-
endif
555+
CTEST_RUSTC_FLAGS = $$(subst --cfg debug,,$$(CFG_RUSTC_FLAGS))
564556

565557
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
566558
--compile-lib-path $$(HLIB$(1)_H_$(3)) \

branches/try2/src/libextra/dlist.rs

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use std::cast;
2626
use std::ptr;
2727
use std::util;
2828
use std::iterator::{FromIterator, Extendable, Invert};
29-
use std::iterator;
3029

3130
use container::Deque;
3231

@@ -590,27 +589,12 @@ impl<A, T: Iterator<A>> Extendable<A, T> for DList<A> {
590589
impl<A: Eq> Eq for DList<A> {
591590
fn eq(&self, other: &DList<A>) -> bool {
592591
self.len() == other.len() &&
593-
iterator::order::eq(self.iter(), other.iter())
592+
self.iter().zip(other.iter()).all(|(a, b)| a.eq(b))
594593
}
595594

595+
#[inline]
596596
fn ne(&self, other: &DList<A>) -> bool {
597-
self.len() != other.len() &&
598-
iterator::order::ne(self.iter(), other.iter())
599-
}
600-
}
601-
602-
impl<A: Eq + Ord> Ord for DList<A> {
603-
fn lt(&self, other: &DList<A>) -> bool {
604-
iterator::order::lt(self.iter(), other.iter())
605-
}
606-
fn le(&self, other: &DList<A>) -> bool {
607-
iterator::order::le(self.iter(), other.iter())
608-
}
609-
fn gt(&self, other: &DList<A>) -> bool {
610-
iterator::order::gt(self.iter(), other.iter())
611-
}
612-
fn ge(&self, other: &DList<A>) -> bool {
613-
iterator::order::ge(self.iter(), other.iter())
597+
!self.eq(other)
614598
}
615599
}
616600

@@ -980,48 +964,6 @@ mod tests {
980964
assert_eq!(&n, &m);
981965
}
982966

983-
#[test]
984-
fn test_ord() {
985-
let n: DList<int> = list_from([]);
986-
let m = list_from([1,2,3]);
987-
assert!(n < m);
988-
assert!(m > n);
989-
assert!(n <= n);
990-
assert!(n >= n);
991-
}
992-
993-
#[test]
994-
fn test_ord_nan() {
995-
let nan = 0.0/0.0;
996-
let n = list_from([nan]);
997-
let m = list_from([nan]);
998-
assert!(!(n < m));
999-
assert!(!(n > m));
1000-
assert!(!(n <= m));
1001-
assert!(!(n >= m));
1002-
1003-
let n = list_from([nan]);
1004-
let one = list_from([1.0]);
1005-
assert!(!(n < one));
1006-
assert!(!(n > one));
1007-
assert!(!(n <= one));
1008-
assert!(!(n >= one));
1009-
1010-
let u = list_from([1.0,2.0,nan]);
1011-
let v = list_from([1.0,2.0,3.0]);
1012-
assert!(!(u < v));
1013-
assert!(!(u > v));
1014-
assert!(!(u <= v));
1015-
assert!(!(u >= v));
1016-
1017-
let s = list_from([1.0,2.0,4.0,2.0]);
1018-
let t = list_from([1.0,2.0,3.0,2.0]);
1019-
assert!(!(s < t));
1020-
assert!(s > one);
1021-
assert!(!(s <= one));
1022-
assert!(s >= one);
1023-
}
1024-
1025967
#[test]
1026968
fn test_fuzz() {
1027969
do 25.times {

branches/try2/src/libstd/iterator.rs

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,163 +1568,6 @@ impl<A: Clone> RandomAccessIterator<A> for Repeat<A> {
15681568
fn idx(&self, _: uint) -> Option<A> { Some(self.element.clone()) }
15691569
}
15701570

1571-
/// Functions for lexicographical ordering of sequences.
1572-
///
1573-
/// Lexicographical ordering through `<`, `<=`, `>=`, `>` requires
1574-
/// that the elements implement both `Eq` and `Ord`.
1575-
///
1576-
/// If two sequences are equal up until the point where one ends,
1577-
/// the shorter sequence compares less.
1578-
pub mod order {
1579-
use cmp;
1580-
use cmp::{TotalEq, TotalOrd, Ord, Eq};
1581-
use option::{Some, None};
1582-
use super::Iterator;
1583-
1584-
/// Compare `a` and `b` for equality using `TotalOrd`
1585-
pub fn equals<A: TotalEq, T: Iterator<A>>(mut a: T, mut b: T) -> bool {
1586-
loop {
1587-
match (a.next(), b.next()) {
1588-
(None, None) => return true,
1589-
(None, _) | (_, None) => return false,
1590-
(Some(x), Some(y)) => if !x.equals(&y) { return false },
1591-
}
1592-
}
1593-
}
1594-
1595-
/// Order `a` and `b` lexicographically using `TotalOrd`
1596-
pub fn cmp<A: TotalOrd, T: Iterator<A>>(mut a: T, mut b: T) -> cmp::Ordering {
1597-
loop {
1598-
match (a.next(), b.next()) {
1599-
(None, None) => return cmp::Equal,
1600-
(None, _ ) => return cmp::Less,
1601-
(_ , None) => return cmp::Greater,
1602-
(Some(x), Some(y)) => match x.cmp(&y) {
1603-
cmp::Equal => (),
1604-
non_eq => return non_eq,
1605-
},
1606-
}
1607-
}
1608-
}
1609-
1610-
/// Compare `a` and `b` for equality (Using partial equality, `Eq`)
1611-
pub fn eq<A: Eq, T: Iterator<A>>(mut a: T, mut b: T) -> bool {
1612-
loop {
1613-
match (a.next(), b.next()) {
1614-
(None, None) => return true,
1615-
(None, _) | (_, None) => return false,
1616-
(Some(x), Some(y)) => if !x.eq(&y) { return false },
1617-
}
1618-
}
1619-
}
1620-
1621-
/// Compare `a` and `b` for nonequality (Using partial equality, `Eq`)
1622-
pub fn ne<A: Eq, T: Iterator<A>>(mut a: T, mut b: T) -> bool {
1623-
loop {
1624-
match (a.next(), b.next()) {
1625-
(None, None) => return false,
1626-
(None, _) | (_, None) => return true,
1627-
(Some(x), Some(y)) => if x.ne(&y) { return true },
1628-
}
1629-
}
1630-
}
1631-
1632-
/// Return `a` < `b` lexicographically (Using partial order, `Ord`)
1633-
pub fn lt<A: Eq + Ord, T: Iterator<A>>(mut a: T, mut b: T) -> bool {
1634-
loop {
1635-
match (a.next(), b.next()) {
1636-
(None, None) => return false,
1637-
(None, _ ) => return true,
1638-
(_ , None) => return false,
1639-
(Some(x), Some(y)) => if x.ne(&y) { return x.lt(&y) },
1640-
}
1641-
}
1642-
}
1643-
1644-
/// Return `a` <= `b` lexicographically (Using partial order, `Ord`)
1645-
pub fn le<A: Eq + Ord, T: Iterator<A>>(mut a: T, mut b: T) -> bool {
1646-
loop {
1647-
match (a.next(), b.next()) {
1648-
(None, None) => return true,
1649-
(None, _ ) => return true,
1650-
(_ , None) => return false,
1651-
(Some(x), Some(y)) => if x.ne(&y) { return x.le(&y) },
1652-
}
1653-
}
1654-
}
1655-
1656-
/// Return `a` > `b` lexicographically (Using partial order, `Ord`)
1657-
pub fn gt<A: Eq + Ord, T: Iterator<A>>(mut a: T, mut b: T) -> bool {
1658-
loop {
1659-
match (a.next(), b.next()) {
1660-
(None, None) => return false,
1661-
(None, _ ) => return false,
1662-
(_ , None) => return true,
1663-
(Some(x), Some(y)) => if x.ne(&y) { return x.gt(&y) },
1664-
}
1665-
}
1666-
}
1667-
1668-
/// Return `a` >= `b` lexicographically (Using partial order, `Ord`)
1669-
pub fn ge<A: Eq + Ord, T: Iterator<A>>(mut a: T, mut b: T) -> bool {
1670-
loop {
1671-
match (a.next(), b.next()) {
1672-
(None, None) => return true,
1673-
(None, _ ) => return false,
1674-
(_ , None) => return true,
1675-
(Some(x), Some(y)) => if x.ne(&y) { return x.ge(&y) },
1676-
}
1677-
}
1678-
}
1679-
1680-
#[test]
1681-
fn test_lt() {
1682-
use vec::ImmutableVector;
1683-
1684-
let empty: [int, ..0] = [];
1685-
let xs = [1,2,3];
1686-
let ys = [1,2,0];
1687-
1688-
assert!(!lt(xs.iter(), ys.iter()));
1689-
assert!(!le(xs.iter(), ys.iter()));
1690-
assert!( gt(xs.iter(), ys.iter()));
1691-
assert!( ge(xs.iter(), ys.iter()));
1692-
1693-
assert!( lt(ys.iter(), xs.iter()));
1694-
assert!( le(ys.iter(), xs.iter()));
1695-
assert!(!gt(ys.iter(), xs.iter()));
1696-
assert!(!ge(ys.iter(), xs.iter()));
1697-
1698-
assert!( lt(empty.iter(), xs.iter()));
1699-
assert!( le(empty.iter(), xs.iter()));
1700-
assert!(!gt(empty.iter(), xs.iter()));
1701-
assert!(!ge(empty.iter(), xs.iter()));
1702-
1703-
// Sequence with NaN
1704-
let u = [1.0, 2.0];
1705-
let v = [0.0/0.0, 3.0];
1706-
1707-
assert!(!lt(u.iter(), v.iter()));
1708-
assert!(!le(u.iter(), v.iter()));
1709-
assert!(!gt(u.iter(), v.iter()));
1710-
assert!(!ge(u.iter(), v.iter()));
1711-
1712-
let a = [0.0/0.0];
1713-
let b = [1.0];
1714-
let c = [2.0];
1715-
1716-
assert!(lt(a.iter(), b.iter()) == (a[0] < b[0]));
1717-
assert!(le(a.iter(), b.iter()) == (a[0] <= b[0]));
1718-
assert!(gt(a.iter(), b.iter()) == (a[0] > b[0]));
1719-
assert!(ge(a.iter(), b.iter()) == (a[0] >= b[0]));
1720-
1721-
assert!(lt(c.iter(), b.iter()) == (c[0] < b[0]));
1722-
assert!(le(c.iter(), b.iter()) == (c[0] <= b[0]));
1723-
assert!(gt(c.iter(), b.iter()) == (c[0] > b[0]));
1724-
assert!(ge(c.iter(), b.iter()) == (c[0] >= b[0]));
1725-
}
1726-
}
1727-
17281571
#[cfg(test)]
17291572
mod tests {
17301573
use super::*;

branches/try2/src/libstd/macros.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,20 @@ macro_rules! rterrln (
1616
} )
1717
)
1818

19-
// Some basic logging. Enabled by passing `--cfg rtdebug` to the libstd build.
19+
// Some basic logging
20+
macro_rules! rtdebug_ (
21+
($( $arg:expr),+) => ( {
22+
rterrln!( $($arg),+ )
23+
} )
24+
)
25+
26+
// An alternate version with no output, for turning off logging. An
27+
// earlier attempt that did not call the fmt! macro was insufficient,
28+
// as a case of the "let bind each variable" approach eventually
29+
// failed without an error message describing the invocation site.
2030
macro_rules! rtdebug (
2131
($( $arg:expr),+) => ( {
22-
if cfg!(rtdebug) {
23-
rterrln!( $($arg),+ )
24-
}
32+
let _x = fmt!( $($arg),+ );
2533
})
2634
)
2735

branches/try2/src/libstd/option.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use ops::Add;
4747
use util;
4848
use num::Zero;
4949
use iterator::Iterator;
50-
use iterator;
5150
use str::{StrSlice, OwnedStr};
5251
use to_str::ToStr;
5352
use clone::DeepClone;
@@ -59,21 +58,31 @@ pub enum Option<T> {
5958
Some(T),
6059
}
6160

62-
impl<T: Eq + Ord> Ord for Option<T> {
61+
impl<T:Ord> Ord for Option<T> {
6362
fn lt(&self, other: &Option<T>) -> bool {
64-
iterator::order::lt(self.iter(), other.iter())
63+
match (self, other) {
64+
(&None, &None) => false,
65+
(&None, &Some(_)) => true,
66+
(&Some(_), &None) => false,
67+
(&Some(ref a), &Some(ref b)) => *a < *b
68+
}
6569
}
6670

6771
fn le(&self, other: &Option<T>) -> bool {
68-
iterator::order::le(self.iter(), other.iter())
72+
match (self, other) {
73+
(&None, &None) => true,
74+
(&None, &Some(_)) => true,
75+
(&Some(_), &None) => false,
76+
(&Some(ref a), &Some(ref b)) => *a <= *b
77+
}
6978
}
7079

7180
fn ge(&self, other: &Option<T>) -> bool {
72-
iterator::order::ge(self.iter(), other.iter())
81+
!(self < other)
7382
}
7483

7584
fn gt(&self, other: &Option<T>) -> bool {
76-
iterator::order::gt(self.iter(), other.iter())
85+
!(self <= other)
7786
}
7887
}
7988

@@ -544,18 +553,6 @@ mod tests {
544553
assert!(it.next().is_none());
545554
}
546555

547-
#[test]
548-
fn test_ord() {
549-
let small = Some(1.0);
550-
let big = Some(5.0);
551-
let nan = Some(0.0/0.0);
552-
assert!(!(nan < big));
553-
assert!(!(nan > big));
554-
assert!(small < big);
555-
assert!(None < big);
556-
assert!(big > None);
557-
}
558-
559556
#[test]
560557
fn test_mutate() {
561558
let mut x = Some(3i);

branches/try2/src/libstd/prelude.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub use from_str::FromStr;
7070
pub use to_bytes::IterBytes;
7171
pub use to_str::{ToStr, ToStrConsume};
7272
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
73-
pub use tuple::{CloneableTuple1, ImmutableTuple1};
7473
pub use tuple::{CloneableTuple2, CloneableTuple3, CloneableTuple4, CloneableTuple5};
7574
pub use tuple::{CloneableTuple6, CloneableTuple7, CloneableTuple8, CloneableTuple9};
7675
pub use tuple::{CloneableTuple10, CloneableTuple11, CloneableTuple12};

0 commit comments

Comments
 (0)