Skip to content

Commit 1e99270

Browse files
committed
---
yaml --- r: 148703 b: refs/heads/try2 c: d7f97e3 h: refs/heads/master i: 148701: 25f26c5 148699: 4f6a8a4 148695: d4bd532 148687: 7627a63 148671: 82bad43 v: v3
1 parent d7dd160 commit 1e99270

File tree

113 files changed

+431
-1044
lines changed

Some content is hidden

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

113 files changed

+431
-1044
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: 3427137f667e7def78f12a69af7d8beb2fcd5e65
8+
refs/heads/try2: d7f97e3018ac664058a507d207676f30fda4bfe4
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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,6 @@ do
916916
LLVM_OPTS="$LLVM_OPTS --disable-terminfo"
917917
# Try to have LLVM pull in as few dependencies as possible (#9397)
918918
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
919-
# LLVM says it needs a "new" clang/gcc, but we seem to get by ok with
920-
# older versions on the bots. Get by for a little longer by asking it to
921-
# not do version detection
922-
LLVM_OPTS="$LLVM_OPTS --disable-compiler-version-checks"
923919

924920
# Use win32 native thread/lock apis instead of pthread wrapper.
925921
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.)

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ syn keyword rustTrait FromStr
7878
syn keyword rustTrait FromIterator Extendable
7979
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator
8080
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
81+
syn keyword rustTrait Times
8182

8283
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
8384
syn keyword rustTrait Bitwise Bounded Integer Fractional Real RealExt
@@ -91,16 +92,16 @@ syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9192
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9293
syn keyword rustTrait IterBytes
9394
syn keyword rustTrait ToStr IntoStr
94-
syn keyword rustTrait CloneableTuple ImmutableTuple
95+
syn keyword rustTrait CopyableTuple ImmutableTuple
9596
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
9697
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
9798
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
9899
syn keyword rustTrait ImmutableTuple1 ImmutableTuple2 ImmutableTuple3 ImmutableTuple4
99100
syn keyword rustTrait ImmutableTuple5 ImmutableTuple6 ImmutableTuple7 ImmutableTuple8
100101
syn keyword rustTrait ImmutableTuple9 ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
101-
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCloneableVector
102-
syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector MutableVector
103-
syn keyword rustTrait Vector VectorVector CloneableVector ImmutableVector
102+
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCopyableVector
103+
syn keyword rustTrait OwnedVector OwnedCopyableVector OwnedEqVector MutableVector
104+
syn keyword rustTrait Vector VectorVector CopyableVector ImmutableVector
104105

105106
"syn keyword rustFunction stream
106107
syn keyword rustTrait Port Chan GenericChan GenericSmartChan GenericPort Peekable

branches/try2/src/libextra/arc.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use sync::{Mutex, RWLock};
4747
use std::cast;
4848
use std::sync::arc::UnsafeArc;
4949
use std::task;
50-
use std::borrow;
50+
use std::reference;
5151

5252
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
5353
pub struct Condvar<'a> {
@@ -465,7 +465,7 @@ impl<T:Freeze + Send> RWArc<T> {
465465
// of this cast is removing the mutability.)
466466
let new_data = data;
467467
// Downgrade ensured the token belonged to us. Just a sanity check.
468-
assert!(borrow::ref_eq(&(*state).data, new_data));
468+
assert!(reference::ref_eq(&(*state).data, new_data));
469469
// Produce new token
470470
RWReadMode {
471471
data: new_data,
@@ -770,19 +770,19 @@ mod tests {
770770

771771
task::spawn(proc() {
772772
arc2.write(|num| {
773-
for _ in range(0, 10) {
773+
10.times(|| {
774774
let tmp = *num;
775775
*num = -1;
776776
task::deschedule();
777777
*num = tmp + 1;
778-
}
778+
});
779779
c.send(());
780780
})
781781
});
782782

783783
// Readers try to catch the writer in the act
784784
let mut children = ~[];
785-
for _ in range(0, 5) {
785+
5.times(|| {
786786
let arc3 = arc.clone();
787787
let mut builder = task::task();
788788
children.push(builder.future_result());
@@ -791,7 +791,7 @@ mod tests {
791791
assert!(*num >= 0);
792792
})
793793
});
794-
}
794+
});
795795

796796
// Wait for children to pass their asserts
797797
for r in children.mut_iter() {
@@ -836,7 +836,7 @@ mod tests {
836836

837837
// Reader tasks
838838
let mut reader_convos = ~[];
839-
for _ in range(0, 10) {
839+
10.times(|| {
840840
let ((rp1, rc1), (rp2, rc2)) = (Chan::new(), Chan::new());
841841
reader_convos.push((rc1, rp2));
842842
let arcn = arc.clone();
@@ -847,7 +847,7 @@ mod tests {
847847
rc2.send(());
848848
})
849849
});
850-
}
850+
});
851851

852852
// Writer task
853853
let arc2 = arc.clone();
@@ -944,7 +944,7 @@ mod tests {
944944
read_mode.read(|state| {
945945
// if writer mistakenly got in, make sure it mutates state
946946
// before we assert on it
947-
for _ in range(0, 5) { task::deschedule(); }
947+
5.times(|| task::deschedule());
948948
// make sure writer didn't get in.
949949
assert!(*state);
950950
})
@@ -956,6 +956,6 @@ mod tests {
956956
// helped to expose the race nearly 100% of the time... but adding
957957
// deschedules in the intuitively-right locations made it even less likely,
958958
// and I wasn't sure why :( . This is a mediocre "next best" option.
959-
for _ in range(0, 8) { test_rw_write_cond_downgrade_read_race_helper(); }
959+
8.times(|| test_rw_write_cond_downgrade_read_race_helper());
960960
}
961961
}

branches/try2/src/libextra/base64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,11 @@ mod test {
336336
use std::rand::{task_rng, random, Rng};
337337
use std::vec;
338338

339-
for _ in range(0, 1000) {
339+
1000.times(|| {
340340
let times = task_rng().gen_range(1u, 100);
341341
let v = vec::from_fn(times, |_| random::<u8>());
342342
assert_eq!(v.to_base64(STANDARD).from_base64().unwrap(), v);
343-
}
343+
})
344344
}
345345

346346
#[bench]

branches/try2/src/libextra/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ mod test {
127127
// Rendezvous streams should be able to handle any number of messages being sent
128128
let (port, chan) = rendezvous();
129129
spawn(proc() {
130-
for _ in range(0, 10000) { chan.send(()); }
130+
10000.times(|| { chan.send(()) })
131131
});
132-
for _ in range(0, 10000) { port.recv(); }
132+
10000.times(|| { port.recv() })
133133
}
134134

135135
#[test]

branches/try2/src/libextra/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,11 +1036,11 @@ mod tests {
10361036

10371037
#[test]
10381038
fn test_fuzz() {
1039-
for _ in range(0, 25) {
1039+
25.times(|| {
10401040
fuzz_test(3);
10411041
fuzz_test(16);
10421042
fuzz_test(189);
1043-
}
1043+
})
10441044
}
10451045

10461046
#[cfg(test)]

branches/try2/src/libextra/getopts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,9 @@ pub mod groups {
726726
// here we just need to indent the start of the description
727727
let rowlen = row.char_len();
728728
if rowlen < 24 {
729-
for _ in range(0, 24 - rowlen) {
730-
row.push_char(' ');
731-
}
729+
(24 - rowlen).times(|| {
730+
row.push_char(' ')
731+
})
732732
} else {
733733
row.push_str(desc_sep)
734734
}

branches/try2/src/libextra/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ fn escape_str(s: &str) -> ~str {
282282

283283
fn spaces(n: uint) -> ~str {
284284
let mut ss = ~"";
285-
for _ in range(0, n) { ss.push_str(" "); }
285+
n.times(|| ss.push_str(" "));
286286
return ss;
287287
}
288288

branches/try2/src/libextra/num/bigint.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,22 +2052,22 @@ mod biguint_tests {
20522052
fn test_rand_range() {
20532053
let mut rng = task_rng();
20542054

2055-
for _ in range(0, 10) {
2055+
10.times(|| {
20562056
assert_eq!(rng.gen_bigint_range(&FromPrimitive::from_uint(236).unwrap(),
20572057
&FromPrimitive::from_uint(237).unwrap()),
20582058
FromPrimitive::from_uint(236).unwrap());
2059-
}
2059+
});
20602060

20612061
let l = FromPrimitive::from_uint(403469000 + 2352).unwrap();
20622062
let u = FromPrimitive::from_uint(403469000 + 3513).unwrap();
2063-
for _ in range(0, 1000) {
2063+
1000.times(|| {
20642064
let n: BigUint = rng.gen_biguint_below(&u);
20652065
assert!(n < u);
20662066

20672067
let n: BigUint = rng.gen_biguint_range(&l, &u);
20682068
assert!(n >= l);
20692069
assert!(n < u);
2070-
}
2070+
})
20712071
}
20722072

20732073
#[test]
@@ -2550,19 +2550,19 @@ mod bigint_tests {
25502550
fn test_rand_range() {
25512551
let mut rng = task_rng();
25522552

2553-
for _ in range(0, 10) {
2553+
10.times(|| {
25542554
assert_eq!(rng.gen_bigint_range(&FromPrimitive::from_uint(236).unwrap(),
25552555
&FromPrimitive::from_uint(237).unwrap()),
25562556
FromPrimitive::from_uint(236).unwrap());
2557-
}
2557+
});
25582558

25592559
fn check(l: BigInt, u: BigInt) {
25602560
let mut rng = task_rng();
2561-
for _ in range(0, 1000) {
2561+
1000.times(|| {
25622562
let n: BigInt = rng.gen_bigint_range(&l, &u);
25632563
assert!(n >= l);
25642564
assert!(n < u);
2565-
}
2565+
});
25662566
}
25672567
let l: BigInt = FromPrimitive::from_uint(403469000 + 2352).unwrap();
25682568
let u: BigInt = FromPrimitive::from_uint(403469000 + 3513).unwrap();

branches/try2/src/libextra/ringbuf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,9 @@ mod tests {
571571
fn bench_grow(b: &mut test::BenchHarness) {
572572
let mut deq = RingBuf::new();
573573
b.iter(|| {
574-
for _ in range(0, 65) {
574+
65.times(|| {
575575
deq.push_front(1);
576-
}
576+
})
577577
})
578578
}
579579

0 commit comments

Comments
 (0)