Skip to content

Commit eb20e4f

Browse files
committed
---
yaml --- r: 143906 b: refs/heads/try2 c: 88b89f8 h: refs/heads/master v: v3
1 parent 8f8c52f commit eb20e4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+879
-2615
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: 59da4e0bc971f3435f6e8b29ed9447a02f21487d
8+
refs/heads/try2: 88b89f84766930b1d6d7be1c558290c40e55d4ff
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ 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"
374375
opt llvm-assertions 1 "build LLVM with assertions"
375376
opt debug 0 "build with extra debug fun"
376377
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: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,15 @@ 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))
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
556564

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

branches/try2/src/etc/zsh/_rust

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ _rustc_opts_switches=(
2727
--sysroot'[Override the system root]'
2828
--test'[Build a test harness]'
2929
--target'[Target triple cpu-manufacturer-kernel\[-os\] to compile]'
30-
--target-cpu'[Select target processor (llc -mcpu=help for details)]'
31-
--target-feature'[Target specific attributes (llc -mattr=help for details)]'
30+
--target-feature'[Target specific attributes (llc -mattr=help for detail)]'
3231
--android-cross-path'[The path to the Android NDK]'
3332
{-v,--version}'[Print version info and exit]'
3433
)

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/libextra/treemap.rs

Lines changed: 88 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
1515

1616
use std::util::{swap, replace};
17-
use std::iterator::{FromIterator, Extendable, Peekable};
18-
use std::cmp::Ordering;
17+
use std::iterator::{FromIterator, Extendable};
1918

2019
// This is implemented as an AA tree, which is a simplified variation of
2120
// a red-black tree where red (horizontal) nodes can only be added
@@ -530,24 +529,24 @@ impl<T: TotalOrd> TreeSet<T> {
530529

531530
/// Visit the values (in-order) representing the difference
532531
pub fn difference<'a>(&'a self, other: &'a TreeSet<T>) -> Difference<'a, T> {
533-
Difference{a: self.iter().peekable(), b: other.iter().peekable()}
532+
Difference{a: Focus::new(self.iter()), b: Focus::new(other.iter())}
534533
}
535534

536535
/// Visit the values (in-order) representing the symmetric difference
537536
pub fn symmetric_difference<'a>(&'a self, other: &'a TreeSet<T>)
538537
-> SymDifference<'a, T> {
539-
SymDifference{a: self.iter().peekable(), b: other.iter().peekable()}
538+
SymDifference{a: Focus::new(self.iter()), b: Focus::new(other.iter())}
540539
}
541540

542541
/// Visit the values (in-order) representing the intersection
543542
pub fn intersection<'a>(&'a self, other: &'a TreeSet<T>)
544543
-> Intersection<'a, T> {
545-
Intersection{a: self.iter().peekable(), b: other.iter().peekable()}
544+
Intersection{a: Focus::new(self.iter()), b: Focus::new(other.iter())}
546545
}
547546

548547
/// Visit the values (in-order) representing the union
549548
pub fn union<'a>(&'a self, other: &'a TreeSet<T>) -> Union<'a, T> {
550-
Union{a: self.iter().peekable(), b: other.iter().peekable()}
549+
Union{a: Focus::new(self.iter()), b: Focus::new(other.iter())}
551550
}
552551
}
553552

@@ -561,47 +560,61 @@ pub struct TreeSetRevIterator<'self, T> {
561560
priv iter: TreeMapRevIterator<'self, T, ()>
562561
}
563562

563+
// Encapsulate an iterator and hold its latest value until stepped forward
564+
struct Focus<A, T> {
565+
priv iter: T,
566+
priv focus: Option<A>,
567+
}
568+
569+
impl<A, T: Iterator<A>> Focus<A, T> {
570+
fn new(mut it: T) -> Focus<A, T> {
571+
Focus{focus: it.next(), iter: it}
572+
}
573+
fn step(&mut self) {
574+
self.focus = self.iter.next()
575+
}
576+
}
577+
564578
/// Lazy iterator producing elements in the set difference (in-order)
565579
pub struct Difference<'self, T> {
566-
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
567-
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
580+
priv a: Focus<&'self T, TreeSetIterator<'self, T>>,
581+
priv b: Focus<&'self T, TreeSetIterator<'self, T>>,
568582
}
569583

570584
/// Lazy iterator producing elements in the set symmetric difference (in-order)
571585
pub struct SymDifference<'self, T> {
572-
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
573-
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
586+
priv a: Focus<&'self T, TreeSetIterator<'self, T>>,
587+
priv b: Focus<&'self T, TreeSetIterator<'self, T>>,
574588
}
575589

576590
/// Lazy iterator producing elements in the set intersection (in-order)
577591
pub struct Intersection<'self, T> {
578-
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
579-
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
592+
priv a: Focus<&'self T, TreeSetIterator<'self, T>>,
593+
priv b: Focus<&'self T, TreeSetIterator<'self, T>>,
580594
}
581595

582596
/// Lazy iterator producing elements in the set intersection (in-order)
583597
pub struct Union<'self, T> {
584-
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
585-
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
586-
}
587-
588-
/// Compare `x` and `y`, but return `short` if x is None and `long` if y is None
589-
fn cmp_opt<T: TotalOrd>(x: Option<&T>, y: Option<&T>,
590-
short: Ordering, long: Ordering) -> Ordering {
591-
match (x, y) {
592-
(None , _ ) => short,
593-
(_ , None ) => long,
594-
(Some(x1), Some(y1)) => x1.cmp(y1),
595-
}
598+
priv a: Focus<&'self T, TreeSetIterator<'self, T>>,
599+
priv b: Focus<&'self T, TreeSetIterator<'self, T>>,
596600
}
597601

598602
impl<'self, T: TotalOrd> Iterator<&'self T> for Difference<'self, T> {
599603
fn next(&mut self) -> Option<&'self T> {
600604
loop {
601-
match cmp_opt(self.a.peek(), self.b.peek(), Less, Less) {
602-
Less => return self.a.next(),
603-
Equal => { self.a.next(); self.b.next(); }
604-
Greater => { self.b.next(); }
605+
match (self.a.focus, self.b.focus) {
606+
(None , _ ) => return None,
607+
(ret , None ) => { self.a.step(); return ret },
608+
(Some(a1), Some(b1)) => {
609+
let cmp = a1.cmp(b1);
610+
if cmp == Less {
611+
self.a.step();
612+
return Some(a1);
613+
} else {
614+
if cmp == Equal { self.a.step() }
615+
self.b.step();
616+
}
617+
}
605618
}
606619
}
607620
}
@@ -610,10 +623,23 @@ impl<'self, T: TotalOrd> Iterator<&'self T> for Difference<'self, T> {
610623
impl<'self, T: TotalOrd> Iterator<&'self T> for SymDifference<'self, T> {
611624
fn next(&mut self) -> Option<&'self T> {
612625
loop {
613-
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
614-
Less => return self.a.next(),
615-
Equal => { self.a.next(); self.b.next(); }
616-
Greater => return self.b.next(),
626+
match (self.a.focus, self.b.focus) {
627+
(ret , None ) => { self.a.step(); return ret },
628+
(None , ret ) => { self.b.step(); return ret },
629+
(Some(a1), Some(b1)) => {
630+
let cmp = a1.cmp(b1);
631+
if cmp == Less {
632+
self.a.step();
633+
return Some(a1);
634+
} else {
635+
self.b.step();
636+
if cmp == Greater {
637+
return Some(b1);
638+
} else {
639+
self.a.step();
640+
}
641+
}
642+
}
617643
}
618644
}
619645
}
@@ -622,16 +648,20 @@ impl<'self, T: TotalOrd> Iterator<&'self T> for SymDifference<'self, T> {
622648
impl<'self, T: TotalOrd> Iterator<&'self T> for Intersection<'self, T> {
623649
fn next(&mut self) -> Option<&'self T> {
624650
loop {
625-
let o_cmp = match (self.a.peek(), self.b.peek()) {
626-
(None , _ ) => None,
627-
(_ , None ) => None,
628-
(Some(a1), Some(b1)) => Some(a1.cmp(b1)),
629-
};
630-
match o_cmp {
631-
None => return None,
632-
Some(Less) => { self.a.next(); }
633-
Some(Equal) => { self.b.next(); return self.a.next() }
634-
Some(Greater) => { self.b.next(); }
651+
match (self.a.focus, self.b.focus) {
652+
(None , _ ) => return None,
653+
(_ , None ) => return None,
654+
(Some(a1), Some(b1)) => {
655+
let cmp = a1.cmp(b1);
656+
if cmp == Less {
657+
self.a.step();
658+
} else {
659+
self.b.step();
660+
if cmp == Equal {
661+
return Some(a1);
662+
}
663+
}
664+
},
635665
}
636666
}
637667
}
@@ -640,10 +670,22 @@ impl<'self, T: TotalOrd> Iterator<&'self T> for Intersection<'self, T> {
640670
impl<'self, T: TotalOrd> Iterator<&'self T> for Union<'self, T> {
641671
fn next(&mut self) -> Option<&'self T> {
642672
loop {
643-
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
644-
Less => return self.a.next(),
645-
Equal => { self.b.next(); return self.a.next() }
646-
Greater => return self.b.next(),
673+
match (self.a.focus, self.b.focus) {
674+
(ret , None) => { self.a.step(); return ret },
675+
(None , ret ) => { self.b.step(); return ret },
676+
(Some(a1), Some(b1)) => {
677+
let cmp = a1.cmp(b1);
678+
if cmp == Greater {
679+
self.b.step();
680+
return Some(b1);
681+
} else {
682+
self.a.step();
683+
if cmp == Equal {
684+
self.b.step();
685+
}
686+
return Some(a1);
687+
}
688+
}
647689
}
648690
}
649691
}

branches/try2/src/librustc/back/abi.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ pub static tydesc_field_take_glue: uint = 2u;
4646
pub static tydesc_field_drop_glue: uint = 3u;
4747
pub static tydesc_field_free_glue: uint = 4u;
4848
pub static tydesc_field_visit_glue: uint = 5u;
49-
pub static tydesc_field_borrow_offset: uint = 6u;
50-
pub static n_tydesc_fields: uint = 7u;
49+
pub static n_tydesc_fields: uint = 6u;
5150

5251
// The two halves of a closure: code and environment.
5352
pub static fn_field_code: uint = 0u;

0 commit comments

Comments
 (0)