Skip to content

Commit b7ab71b

Browse files
committed
---
yaml --- r: 101335 b: refs/heads/master c: e532e8d h: refs/heads/master i: 101333: 49fd63b 101331: ab20c30 101327: 0a883dd v: v3
1 parent 5badb13 commit b7ab71b

File tree

133 files changed

+664
-1315
lines changed

Some content is hidden

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

133 files changed

+664
-1315
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: bec01ad17c6a519c38063d99b8863bf1f801f226
2+
refs/heads/master: e532e8d55d4f8a327b7163606c537fe3e358b03a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/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.)

trunk/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ match mypoint {
646646
## Enums
647647

648648
Enums are datatypes that have several alternate representations. For
649-
example, consider the following type:
649+
example, consider the type shown earlier:
650650

651651
~~~~
652652
# struct Point { x: f64, y: f64 }

trunk/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

trunk/src/libextra/arc.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -47,6 +47,7 @@ use sync::{Mutex, RWLock};
4747
use std::cast;
4848
use std::sync::arc::UnsafeArc;
4949
use std::task;
50+
use std::borrow;
5051

5152
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
5253
pub struct Condvar<'a> {
@@ -464,7 +465,7 @@ impl<T:Freeze + Send> RWArc<T> {
464465
// of this cast is removing the mutability.)
465466
let new_data = data;
466467
// Downgrade ensured the token belonged to us. Just a sanity check.
467-
assert!((&(*state).data as *T as uint) == (new_data as *mut T as uint));
468+
assert!(borrow::ref_eq(&(*state).data, new_data));
468469
// Produce new token
469470
RWReadMode {
470471
data: new_data,
@@ -769,19 +770,19 @@ mod tests {
769770

770771
task::spawn(proc() {
771772
arc2.write(|num| {
772-
for _ in range(0, 10) {
773+
10.times(|| {
773774
let tmp = *num;
774775
*num = -1;
775776
task::deschedule();
776777
*num = tmp + 1;
777-
}
778+
});
778779
c.send(());
779780
})
780781
});
781782

782783
// Readers try to catch the writer in the act
783784
let mut children = ~[];
784-
for _ in range(0, 5) {
785+
5.times(|| {
785786
let arc3 = arc.clone();
786787
let mut builder = task::task();
787788
children.push(builder.future_result());
@@ -790,7 +791,7 @@ mod tests {
790791
assert!(*num >= 0);
791792
})
792793
});
793-
}
794+
});
794795

795796
// Wait for children to pass their asserts
796797
for r in children.mut_iter() {
@@ -835,7 +836,7 @@ mod tests {
835836

836837
// Reader tasks
837838
let mut reader_convos = ~[];
838-
for _ in range(0, 10) {
839+
10.times(|| {
839840
let ((rp1, rc1), (rp2, rc2)) = (Chan::new(), Chan::new());
840841
reader_convos.push((rc1, rp2));
841842
let arcn = arc.clone();
@@ -846,7 +847,7 @@ mod tests {
846847
rc2.send(());
847848
})
848849
});
849-
}
850+
});
850851

851852
// Writer task
852853
let arc2 = arc.clone();
@@ -943,7 +944,7 @@ mod tests {
943944
read_mode.read(|state| {
944945
// if writer mistakenly got in, make sure it mutates state
945946
// before we assert on it
946-
for _ in range(0, 5) { task::deschedule(); }
947+
5.times(|| task::deschedule());
947948
// make sure writer didn't get in.
948949
assert!(*state);
949950
})
@@ -955,6 +956,6 @@ mod tests {
955956
// helped to expose the race nearly 100% of the time... but adding
956957
// deschedules in the intuitively-right locations made it even less likely,
957958
// and I wasn't sure why :( . This is a mediocre "next best" option.
958-
for _ in range(0, 8) { test_rw_write_cond_downgrade_read_race_helper(); }
959+
8.times(|| test_rw_write_cond_downgrade_read_race_helper());
959960
}
960961
}

trunk/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]

trunk/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]

trunk/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)]

trunk/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
}

trunk/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

trunk/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();

trunk/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)