Skip to content

Commit ec8815f

Browse files
committed
---
yaml --- r: 168536 b: refs/heads/batch c: 71b46b1 h: refs/heads/master v: v3
1 parent 817cad3 commit ec8815f

File tree

189 files changed

+2172
-1320
lines changed

Some content is hidden

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

189 files changed

+2172
-1320
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: 8dbaa7105e5a5177c5f326972607b41c6083ffd3
32+
refs/heads/batch: 71b46b18a274edc7f7fb60b490e5ebbb9c911462
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970

branches/batch/src/doc/guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,18 +1606,18 @@ things. The most basic is the **array**, a fixed-size list of elements of the
16061606
same type. By default, arrays are immutable.
16071607

16081608
```{rust}
1609-
let a = [1i, 2i, 3i]; // a: [int, ..3]
1610-
let mut m = [1i, 2i, 3i]; // mut m: [int, ..3]
1609+
let a = [1i, 2i, 3i]; // a: [int; 3]
1610+
let mut m = [1i, 2i, 3i]; // mut m: [int; 3]
16111611
```
16121612

16131613
There's a shorthand for initializing each element of an array to the same
16141614
value. In this example, each element of `a` will be initialized to `0i`:
16151615

16161616
```{rust}
1617-
let a = [0i, ..20]; // a: [int, ..20]
1617+
let a = [0i; 20]; // a: [int; 20]
16181618
```
16191619

1620-
Arrays have type `[T,..N]`. We'll talk about this `T` notation later, when we
1620+
Arrays have type `[T; N]`. We'll talk about this `T` notation later, when we
16211621
cover generics.
16221622

16231623
You can get the number of elements in an array `a` with `a.len()`, and use

branches/batch/src/doc/reference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,11 +1438,11 @@ the `static` lifetime, fixed-size arrays, tuples, enum variants, and structs.
14381438
const BIT1: uint = 1 << 0;
14391439
const BIT2: uint = 1 << 1;
14401440
1441-
const BITS: [uint, ..2] = [BIT1, BIT2];
1441+
const BITS: [uint; 2] = [BIT1, BIT2];
14421442
const STRING: &'static str = "bitstring";
14431443
14441444
struct BitsNStrings<'a> {
1445-
mybits: [uint, ..2],
1445+
mybits: [uint; 2],
14461446
mystring: &'a str
14471447
}
14481448
@@ -2923,7 +2923,7 @@ constant expression that can be evaluated at compile time, such as a
29232923
```
29242924
[1i, 2, 3, 4];
29252925
["a", "b", "c", "d"];
2926-
[0i, ..128]; // array with 128 zeros
2926+
[0i; 128]; // array with 128 zeros
29272927
[0u8, 0u8, 0u8, 0u8];
29282928
```
29292929

@@ -3691,7 +3691,7 @@ An example of each kind:
36913691

36923692
```{rust}
36933693
let vec: Vec<int> = vec![1, 2, 3];
3694-
let arr: [int, ..3] = [1, 2, 3];
3694+
let arr: [int; 3] = [1, 2, 3];
36953695
let s: &[int] = vec.as_slice();
36963696
```
36973697

branches/batch/src/liballoc/rc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,13 @@ impl<T> Clone for Weak<T> {
719719
}
720720
}
721721

722+
#[experimental = "Show is experimental."]
723+
impl<T: fmt::Show> fmt::Show for Weak<T> {
724+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
725+
write!(f, "(Weak)")
726+
}
727+
}
728+
722729
#[doc(hidden)]
723730
trait RcBoxPtr<T> {
724731
fn inner(&self) -> &RcBox<T>;

branches/batch/src/libcollections/dlist.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ mod tests {
12611261

12621262
#[bench]
12631263
fn bench_collect_into(b: &mut test::Bencher) {
1264-
let v = &[0i, ..64];
1264+
let v = &[0i; 64];
12651265
b.iter(|| {
12661266
let _: DList<int> = v.iter().map(|x| *x).collect();
12671267
})
@@ -1323,31 +1323,31 @@ mod tests {
13231323

13241324
#[bench]
13251325
fn bench_iter(b: &mut test::Bencher) {
1326-
let v = &[0i, ..128];
1326+
let v = &[0i; 128];
13271327
let m: DList<int> = v.iter().map(|&x|x).collect();
13281328
b.iter(|| {
13291329
assert!(m.iter().count() == 128);
13301330
})
13311331
}
13321332
#[bench]
13331333
fn bench_iter_mut(b: &mut test::Bencher) {
1334-
let v = &[0i, ..128];
1334+
let v = &[0i; 128];
13351335
let mut m: DList<int> = v.iter().map(|&x|x).collect();
13361336
b.iter(|| {
13371337
assert!(m.iter_mut().count() == 128);
13381338
})
13391339
}
13401340
#[bench]
13411341
fn bench_iter_rev(b: &mut test::Bencher) {
1342-
let v = &[0i, ..128];
1342+
let v = &[0i; 128];
13431343
let m: DList<int> = v.iter().map(|&x|x).collect();
13441344
b.iter(|| {
13451345
assert!(m.iter().rev().count() == 128);
13461346
})
13471347
}
13481348
#[bench]
13491349
fn bench_iter_mut_rev(b: &mut test::Bencher) {
1350-
let v = &[0i, ..128];
1350+
let v = &[0i; 128];
13511351
let mut m: DList<int> = v.iter().map(|&x|x).collect();
13521352
b.iter(|| {
13531353
assert!(m.iter_mut().rev().count() == 128);

branches/batch/src/libcollections/slice.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ pub trait SliceExt<T> for Sized? {
382382
fn get_mut(&mut self, index: uint) -> Option<&mut T>;
383383

384384
/// Work with `self` as a mut slice.
385-
/// Primarily intended for getting a &mut [T] from a [T, ..N].
385+
/// Primarily intended for getting a &mut [T] from a [T; N].
386386
#[stable]
387387
fn as_mut_slice(&mut self) -> &mut [T];
388388

@@ -861,6 +861,7 @@ pub trait CloneSliceExt<T> for Sized? {
861861
fn clone_from_slice(&mut self, &[T]) -> uint;
862862
}
863863

864+
864865
#[unstable = "trait is unstable"]
865866
impl<T: Clone> CloneSliceExt<T> for [T] {
866867
/// Returns a copy of `v`.
@@ -1482,14 +1483,14 @@ mod tests {
14821483

14831484
#[test]
14841485
fn test_is_empty() {
1485-
let xs: [int, ..0] = [];
1486+
let xs: [int; 0] = [];
14861487
assert!(xs.is_empty());
14871488
assert!(![0i].is_empty());
14881489
}
14891490

14901491
#[test]
14911492
fn test_len_divzero() {
1492-
type Z = [i8, ..0];
1493+
type Z = [i8; 0];
14931494
let v0 : &[Z] = &[];
14941495
let v1 : &[Z] = &[[]];
14951496
let v2 : &[Z] = &[[], []];
@@ -1856,7 +1857,7 @@ mod tests {
18561857
#[test]
18571858
fn test_permutations() {
18581859
{
1859-
let v: [int, ..0] = [];
1860+
let v: [int; 0] = [];
18601861
let mut it = v.permutations();
18611862
let (min_size, max_opt) = it.size_hint();
18621863
assert_eq!(min_size, 1);
@@ -2059,7 +2060,7 @@ mod tests {
20592060
}
20602061

20612062
// shouldn't panic
2062-
let mut v: [uint, .. 0] = [];
2063+
let mut v: [uint; 0] = [];
20632064
v.sort();
20642065

20652066
let mut v = [0xDEADBEEFu];
@@ -2071,7 +2072,7 @@ mod tests {
20712072
fn test_sort_stability() {
20722073
for len in range(4i, 25) {
20732074
for _ in range(0u, 10) {
2074-
let mut counts = [0i, .. 10];
2075+
let mut counts = [0i; 10];
20752076

20762077
// create a vector like [(6, 1), (5, 1), (6, 2), ...],
20772078
// where the first item of each tuple is random, but
@@ -2116,28 +2117,28 @@ mod tests {
21162117

21172118
#[test]
21182119
fn test_concat() {
2119-
let v: [Vec<int>, ..0] = [];
2120+
let v: [Vec<int>; 0] = [];
21202121
let c: Vec<int> = v.concat();
21212122
assert_eq!(c, []);
21222123
let d: Vec<int> = [vec![1i], vec![2i,3i]].concat();
21232124
assert_eq!(d, vec![1i, 2, 3]);
21242125

2125-
let v: [&[int], ..2] = [&[1], &[2, 3]];
2126+
let v: [&[int]; 2] = [&[1], &[2, 3]];
21262127
assert_eq!(v.connect(&0), vec![1i, 0, 2, 3]);
2127-
let v: [&[int], ..3] = [&[1i], &[2], &[3]];
2128+
let v: [&[int]; 3] = [&[1i], &[2], &[3]];
21282129
assert_eq!(v.connect(&0), vec![1i, 0, 2, 0, 3]);
21292130
}
21302131

21312132
#[test]
21322133
fn test_connect() {
2133-
let v: [Vec<int>, ..0] = [];
2134+
let v: [Vec<int>; 0] = [];
21342135
assert_eq!(v.connect_vec(&0), vec![]);
21352136
assert_eq!([vec![1i], vec![2i, 3]].connect_vec(&0), vec![1, 0, 2, 3]);
21362137
assert_eq!([vec![1i], vec![2i], vec![3i]].connect_vec(&0), vec![1, 0, 2, 0, 3]);
21372138

2138-
let v: [&[int], ..2] = [&[1], &[2, 3]];
2139+
let v: [&[int]; 2] = [&[1], &[2, 3]];
21392140
assert_eq!(v.connect_vec(&0), vec![1, 0, 2, 3]);
2140-
let v: [&[int], ..3] = [&[1], &[2], &[3]];
2141+
let v: [&[int]; 3] = [&[1], &[2], &[3]];
21412142
assert_eq!(v.connect_vec(&0), vec![1, 0, 2, 0, 3]);
21422143
}
21432144

@@ -2710,7 +2711,7 @@ mod tests {
27102711
}
27112712
assert_eq!(cnt, 11);
27122713

2713-
let xs: [Foo, ..3] = [Foo, Foo, Foo];
2714+
let xs: [Foo; 3] = [Foo, Foo, Foo];
27142715
cnt = 0;
27152716
for f in xs.iter() {
27162717
assert!(*f == Foo);

branches/batch/src/libcollections/str.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<'a> Iterator<char> for Decompositions<'a> {
202202
let buffer = &mut self.buffer;
203203
let sorted = &mut self.sorted;
204204
{
205-
let callback = |d| {
205+
let callback = |&mut: d| {
206206
let class =
207207
unicode::char::canonical_combining_class(d);
208208
if class == 0 && !*sorted {
@@ -2517,7 +2517,7 @@ mod tests {
25172517

25182518
#[test]
25192519
fn test_chars_decoding() {
2520-
let mut bytes = [0u8, ..4];
2520+
let mut bytes = [0u8; 4];
25212521
for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) {
25222522
let len = c.encode_utf8(&mut bytes).unwrap_or(0);
25232523
let s = ::core::str::from_utf8(bytes[..len]).unwrap();
@@ -2529,7 +2529,7 @@ mod tests {
25292529

25302530
#[test]
25312531
fn test_chars_rev_decoding() {
2532-
let mut bytes = [0u8, ..4];
2532+
let mut bytes = [0u8; 4];
25332533
for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) {
25342534
let len = c.encode_utf8(&mut bytes).unwrap_or(0);
25352535
let s = ::core::str::from_utf8(bytes[..len]).unwrap();
@@ -2743,7 +2743,7 @@ mod tests {
27432743
use core::iter::order;
27442744
// official Unicode test data
27452745
// from http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt
2746-
let test_same: [(_, &[_]), .. 325] = [
2746+
let test_same: [(_, &[_]); 325] = [
27472747
("\u{20}\u{20}", &["\u{20}", "\u{20}"]),
27482748
("\u{20}\u{308}\u{20}", &["\u{20}\u{308}", "\u{20}"]),
27492749
("\u{20}\u{D}", &["\u{20}", "\u{D}"]),
@@ -3075,7 +3075,7 @@ mod tests {
30753075
("\u{646}\u{200D}\u{20}", &["\u{646}\u{200D}", "\u{20}"]),
30763076
];
30773077

3078-
let test_diff: [(_, &[_], &[_]), .. 23] = [
3078+
let test_diff: [(_, &[_], &[_]); 23] = [
30793079
("\u{20}\u{903}", &["\u{20}\u{903}"], &["\u{20}", "\u{903}"]), ("\u{20}\u{308}\u{903}",
30803080
&["\u{20}\u{308}\u{903}"], &["\u{20}\u{308}", "\u{903}"]), ("\u{D}\u{308}\u{903}",
30813081
&["\u{D}", "\u{308}\u{903}"], &["\u{D}", "\u{308}", "\u{903}"]), ("\u{A}\u{308}\u{903}",

branches/batch/src/libcollections/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl String {
675675
assert!(idx <= len);
676676
assert!(self.is_char_boundary(idx));
677677
self.vec.reserve(4);
678-
let mut bits = [0, ..4];
678+
let mut bits = [0; 4];
679679
let amt = ch.encode_utf8(&mut bits).unwrap();
680680

681681
unsafe {

branches/batch/src/libcore/array.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,33 @@ macro_rules! array_impls {
2626
($($N:expr)+) => {
2727
$(
2828
#[stable]
29-
impl<T:Copy> Clone for [T, ..$N] {
30-
fn clone(&self) -> [T, ..$N] {
29+
impl<T:Copy> Clone for [T; $N] {
30+
fn clone(&self) -> [T; $N] {
3131
*self
3232
}
3333
}
3434

3535
#[unstable = "waiting for Show to stabilize"]
36-
impl<T:fmt::Show> fmt::Show for [T, ..$N] {
36+
impl<T:fmt::Show> fmt::Show for [T; $N] {
3737
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3838
fmt::Show::fmt(&self[], f)
3939
}
4040
}
4141

4242
#[stable]
43-
impl<A, B> PartialEq<[B, ..$N]> for [A, ..$N] where A: PartialEq<B> {
43+
impl<A, B> PartialEq<[B; $N]> for [A; $N] where A: PartialEq<B> {
4444
#[inline]
45-
fn eq(&self, other: &[B, ..$N]) -> bool {
45+
fn eq(&self, other: &[B; $N]) -> bool {
4646
self[] == other[]
4747
}
4848
#[inline]
49-
fn ne(&self, other: &[B, ..$N]) -> bool {
49+
fn ne(&self, other: &[B; $N]) -> bool {
5050
self[] != other[]
5151
}
5252
}
5353

5454
#[stable]
55-
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A, ..$N] where
55+
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; $N] where
5656
A: PartialEq<B>,
5757
Rhs: Deref<[B]>,
5858
{
@@ -63,47 +63,47 @@ macro_rules! array_impls {
6363
}
6464

6565
#[stable]
66-
impl<'a, A, B, Lhs> PartialEq<[B, ..$N]> for Lhs where
66+
impl<'a, A, B, Lhs> PartialEq<[B; $N]> for Lhs where
6767
A: PartialEq<B>,
6868
Lhs: Deref<[A]>
6969
{
7070
#[inline(always)]
71-
fn eq(&self, other: &[B, ..$N]) -> bool { PartialEq::eq(&**self, other[]) }
71+
fn eq(&self, other: &[B; $N]) -> bool { PartialEq::eq(&**self, other[]) }
7272
#[inline(always)]
73-
fn ne(&self, other: &[B, ..$N]) -> bool { PartialEq::ne(&**self, other[]) }
73+
fn ne(&self, other: &[B; $N]) -> bool { PartialEq::ne(&**self, other[]) }
7474
}
7575

7676
#[stable]
77-
impl<T:Eq> Eq for [T, ..$N] { }
77+
impl<T:Eq> Eq for [T; $N] { }
7878

7979
#[stable]
80-
impl<T:PartialOrd> PartialOrd for [T, ..$N] {
80+
impl<T:PartialOrd> PartialOrd for [T; $N] {
8181
#[inline]
82-
fn partial_cmp(&self, other: &[T, ..$N]) -> Option<Ordering> {
82+
fn partial_cmp(&self, other: &[T; $N]) -> Option<Ordering> {
8383
PartialOrd::partial_cmp(&self[], &other[])
8484
}
8585
#[inline]
86-
fn lt(&self, other: &[T, ..$N]) -> bool {
86+
fn lt(&self, other: &[T; $N]) -> bool {
8787
PartialOrd::lt(&self[], &other[])
8888
}
8989
#[inline]
90-
fn le(&self, other: &[T, ..$N]) -> bool {
90+
fn le(&self, other: &[T; $N]) -> bool {
9191
PartialOrd::le(&self[], &other[])
9292
}
9393
#[inline]
94-
fn ge(&self, other: &[T, ..$N]) -> bool {
94+
fn ge(&self, other: &[T; $N]) -> bool {
9595
PartialOrd::ge(&self[], &other[])
9696
}
9797
#[inline]
98-
fn gt(&self, other: &[T, ..$N]) -> bool {
98+
fn gt(&self, other: &[T; $N]) -> bool {
9999
PartialOrd::gt(&self[], &other[])
100100
}
101101
}
102102

103103
#[stable]
104-
impl<T:Ord> Ord for [T, ..$N] {
104+
impl<T:Ord> Ord for [T; $N] {
105105
#[inline]
106-
fn cmp(&self, other: &[T, ..$N]) -> Ordering {
106+
fn cmp(&self, other: &[T; $N]) -> Ordering {
107107
Ord::cmp(&self[], &other[])
108108
}
109109
}

0 commit comments

Comments
 (0)