Skip to content

Commit 2c92dde

Browse files
committed
More fallout
1 parent 13392d1 commit 2c92dde

Some content is hidden

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

47 files changed

+149
-149
lines changed

src/doc/guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ value. In this example, each element of `a` will be initialized to `0i`:
16171617
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

src/libcollections/slice.rs

+3-3
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

@@ -2060,7 +2060,7 @@ mod tests {
20602060
}
20612061

20622062
// shouldn't panic
2063-
let mut v: [uint, .. 0] = [];
2063+
let mut v: [uint; 0] = [];
20642064
v.sort();
20652065

20662066
let mut v = [0xDEADBEEFu];
@@ -2072,7 +2072,7 @@ mod tests {
20722072
fn test_sort_stability() {
20732073
for len in range(4i, 25) {
20742074
for _ in range(0u, 10) {
2075-
let mut counts = [0i, .. 10];
2075+
let mut counts = [0i; 10];
20762076

20772077
// create a vector like [(6, 1), (5, 1), (6, 2), ...],
20782078
// where the first item of each tuple is random, but

src/libcollections/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -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}",

src/libcore/array.rs

+19-19
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
}

src/libcore/hash/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ macro_rules! impl_hash {
100100
impl<S: Writer> Hash<S> for $ty {
101101
#[inline]
102102
fn hash(&self, state: &mut S) {
103-
let a: [u8, ..::$ty::BYTES] = unsafe {
103+
let a: [u8; ::$ty::BYTES] = unsafe {
104104
mem::transmute((*self as $uty).to_le() as $ty)
105105
};
106106
state.write(a.as_slice())

src/liblibc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ pub mod types {
16321632
#[repr(C)]
16331633
#[deriving(Copy)] pub struct WSAPROTOCOLCHAIN {
16341634
pub ChainLen: c_int,
1635-
pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN as uint],
1635+
pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as uint],
16361636
}
16371637

16381638
pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
@@ -1658,7 +1658,7 @@ pub mod types {
16581658
pub iSecurityScheme: c_int,
16591659
pub dwMessageSize: DWORD,
16601660
pub dwProviderReserved: DWORD,
1661-
pub szProtocol: [u8, ..(WSAPROTOCOL_LEN as uint) + 1u],
1661+
pub szProtocol: [u8; (WSAPROTOCOL_LEN as uint) + 1u],
16621662
}
16631663

16641664
pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;

src/librand/chacha.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of
3131
3232
#[deriving(Copy)]
3333
pub struct ChaChaRng {
34-
buffer: [u32, ..STATE_WORDS], // Internal buffer of output
35-
state: [u32, ..STATE_WORDS], // Initial state
34+
buffer: [u32; STATE_WORDS], // Internal buffer of output
35+
state: [u32; STATE_WORDS], // Initial state
3636
index: uint, // Index into state
3737
}
3838

3939
static EMPTY: ChaChaRng = ChaChaRng {
40-
buffer: [0, ..STATE_WORDS],
41-
state: [0, ..STATE_WORDS],
40+
buffer: [0; STATE_WORDS],
41+
state: [0; STATE_WORDS],
4242
index: STATE_WORDS
4343
};
4444

@@ -68,7 +68,7 @@ macro_rules! double_round{
6868
}
6969

7070
#[inline]
71-
fn core(output: &mut [u32, ..STATE_WORDS], input: &[u32, ..STATE_WORDS]) {
71+
fn core(output: &mut [u32; STATE_WORDS], input: &[u32; STATE_WORDS]) {
7272
*output = *input;
7373

7474
for _ in range(0, CHACHA_ROUNDS / 2) {
@@ -86,7 +86,7 @@ impl ChaChaRng {
8686
/// fixed key of 8 zero words.
8787
pub fn new_unseeded() -> ChaChaRng {
8888
let mut rng = EMPTY;
89-
rng.init(&[0, ..KEY_WORDS]);
89+
rng.init(&[0; KEY_WORDS]);
9090
rng
9191
}
9292

@@ -124,7 +124,7 @@ impl ChaChaRng {
124124
/// ```
125125
/// [1]: Daniel J. Bernstein. [*Extending the Salsa20
126126
/// nonce.*](http://cr.yp.to/papers.html#xsalsa)
127-
fn init(&mut self, key: &[u32, ..KEY_WORDS]) {
127+
fn init(&mut self, key: &[u32; KEY_WORDS]) {
128128
self.state[0] = 0x61707865;
129129
self.state[1] = 0x3320646E;
130130
self.state[2] = 0x79622D32;
@@ -174,7 +174,7 @@ impl<'a> SeedableRng<&'a [u32]> for ChaChaRng {
174174

175175
fn reseed(&mut self, seed: &'a [u32]) {
176176
// reset state
177-
self.init(&[0u32, ..KEY_WORDS]);
177+
self.init(&[0u32; KEY_WORDS]);
178178
// set key in place
179179
let key = self.state.slice_mut(4, 4+KEY_WORDS);
180180
for (k, s) in key.iter_mut().zip(seed.iter()) {
@@ -195,7 +195,7 @@ impl<'a> SeedableRng<&'a [u32]> for ChaChaRng {
195195

196196
impl Rand for ChaChaRng {
197197
fn rand<R: Rng>(other: &mut R) -> ChaChaRng {
198-
let mut key : [u32, ..KEY_WORDS] = [0, ..KEY_WORDS];
198+
let mut key : [u32; KEY_WORDS] = [0; KEY_WORDS];
199199
for word in key.iter_mut() {
200200
*word = other.gen();
201201
}

src/librand/distributions/ziggurat_tables.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Tables for distributions which are sampled using the ziggurat
1212
// algorithm. Autogenerated by `ziggurat_tables.py`.
1313

14-
pub type ZigTable = &'static [f64, .. 257];
14+
pub type ZigTable = &'static [f64; 257];
1515
pub static ZIG_NORM_R: f64 = 3.654152885361008796;
16-
pub static ZIG_NORM_X: [f64, .. 257] =
16+
pub static ZIG_NORM_X: [f64; 257] =
1717
[3.910757959537090045, 3.654152885361008796, 3.449278298560964462, 3.320244733839166074,
1818
3.224575052047029100, 3.147889289517149969, 3.083526132001233044, 3.027837791768635434,
1919
2.978603279880844834, 2.934366867207854224, 2.894121053612348060, 2.857138730872132548,
@@ -79,7 +79,7 @@ pub static ZIG_NORM_X: [f64, .. 257] =
7979
0.487443966121754335, 0.463634336771763245, 0.437518402186662658, 0.408389134588000746,
8080
0.375121332850465727, 0.335737519180459465, 0.286174591747260509, 0.215241895913273806,
8181
0.000000000000000000];
82-
pub static ZIG_NORM_F: [f64, .. 257] =
82+
pub static ZIG_NORM_F: [f64; 257] =
8383
[0.000477467764586655, 0.001260285930498598, 0.002609072746106363, 0.004037972593371872,
8484
0.005522403299264754, 0.007050875471392110, 0.008616582769422917, 0.010214971439731100,
8585
0.011842757857943104, 0.013497450601780807, 0.015177088307982072, 0.016880083152595839,
@@ -146,7 +146,7 @@ pub static ZIG_NORM_F: [f64, .. 257] =
146146
0.932060075968990209, 0.945198953453078028, 0.959879091812415930, 0.977101701282731328,
147147
1.000000000000000000];
148148
pub static ZIG_EXP_R: f64 = 7.697117470131050077;
149-
pub static ZIG_EXP_X: [f64, .. 257] =
149+
pub static ZIG_EXP_X: [f64; 257] =
150150
[8.697117470131052741, 7.697117470131050077, 6.941033629377212577, 6.478378493832569696,
151151
6.144164665772472667, 5.882144315795399869, 5.666410167454033697, 5.482890627526062488,
152152
5.323090505754398016, 5.181487281301500047, 5.054288489981304089, 4.938777085901250530,
@@ -212,7 +212,7 @@ pub static ZIG_EXP_X: [f64, .. 257] =
212212
0.253658363385912022, 0.233790483059674731, 0.212671510630966620, 0.189958689622431842,
213213
0.165127622564187282, 0.137304980940012589, 0.104838507565818778, 0.063852163815001570,
214214
0.000000000000000000];
215-
pub static ZIG_EXP_F: [f64, .. 257] =
215+
pub static ZIG_EXP_F: [f64; 257] =
216216
[0.000167066692307963, 0.000454134353841497, 0.000967269282327174, 0.001536299780301573,
217217
0.002145967743718907, 0.002788798793574076, 0.003460264777836904, 0.004157295120833797,
218218
0.004877655983542396, 0.005619642207205489, 0.006381905937319183, 0.007163353183634991,

src/librand/isaac.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ const RAND_SIZE_UINT: uint = 1 << (RAND_SIZE_LEN as uint);
3232
#[deriving(Copy)]
3333
pub struct IsaacRng {
3434
cnt: u32,
35-
rsl: [u32, ..RAND_SIZE_UINT],
36-
mem: [u32, ..RAND_SIZE_UINT],
35+
rsl: [u32; RAND_SIZE_UINT],
36+
mem: [u32; RAND_SIZE_UINT],
3737
a: u32,
3838
b: u32,
3939
c: u32
4040
}
4141

4242
static EMPTY: IsaacRng = IsaacRng {
4343
cnt: 0,
44-
rsl: [0, ..RAND_SIZE_UINT],
45-
mem: [0, ..RAND_SIZE_UINT],
44+
rsl: [0; RAND_SIZE_UINT],
45+
mem: [0; RAND_SIZE_UINT],
4646
a: 0, b: 0, c: 0
4747
};
4848

@@ -267,17 +267,17 @@ const RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN;
267267
#[deriving(Copy)]
268268
pub struct Isaac64Rng {
269269
cnt: uint,
270-
rsl: [u64, .. RAND_SIZE_64],
271-
mem: [u64, .. RAND_SIZE_64],
270+
rsl: [u64; RAND_SIZE_64],
271+
mem: [u64; RAND_SIZE_64],
272272
a: u64,
273273
b: u64,
274274
c: u64,
275275
}
276276

277277
static EMPTY_64: Isaac64Rng = Isaac64Rng {
278278
cnt: 0,
279-
rsl: [0, .. RAND_SIZE_64],
280-
mem: [0, .. RAND_SIZE_64],
279+
rsl: [0; RAND_SIZE_64],
280+
mem: [0; RAND_SIZE_64],
281281
a: 0, b: 0, c: 0,
282282
};
283283

@@ -358,7 +358,7 @@ impl Isaac64Rng {
358358
let mut a = self.a;
359359
let mut b = self.b + self.c;
360360
const MIDPOINT: uint = RAND_SIZE_64 / 2;
361-
const MP_VEC: [(uint, uint), .. 2] = [(0,MIDPOINT), (MIDPOINT, 0)];
361+
const MP_VEC: [(uint, uint); 2] = [(0,MIDPOINT), (MIDPOINT, 0)];
362362
macro_rules! ind (
363363
($x:expr) => {
364364
*self.mem.get_unchecked(($x as uint >> 3) & (RAND_SIZE_64 - 1))

src/librand/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub trait Rng {
140140
/// ```rust
141141
/// use std::rand::{thread_rng, Rng};
142142
///
143-
/// let mut v = [0u8, .. 13579];
143+
/// let mut v = [0u8; 13579];
144144
/// thread_rng().fill_bytes(&mut v);
145145
/// println!("{}", v.as_slice());
146146
/// ```
@@ -429,9 +429,9 @@ impl Rng for XorShiftRng {
429429
}
430430
}
431431

432-
impl SeedableRng<[u32, .. 4]> for XorShiftRng {
432+
impl SeedableRng<[u32; 4]> for XorShiftRng {
433433
/// Reseed an XorShiftRng. This will panic if `seed` is entirely 0.
434-
fn reseed(&mut self, seed: [u32, .. 4]) {
434+
fn reseed(&mut self, seed: [u32; 4]) {
435435
assert!(!seed.iter().all(|&x| x == 0),
436436
"XorShiftRng.reseed called with an all zero seed.");
437437

@@ -442,7 +442,7 @@ impl SeedableRng<[u32, .. 4]> for XorShiftRng {
442442
}
443443

444444
/// Create a new XorShiftRng. This will panic if `seed` is entirely 0.
445-
fn from_seed(seed: [u32, .. 4]) -> XorShiftRng {
445+
fn from_seed(seed: [u32; 4]) -> XorShiftRng {
446446
assert!(!seed.iter().all(|&x| x == 0),
447447
"XorShiftRng::from_seed called with an all zero seed.");
448448

src/libregex_macros/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,
169169
chars: CharReader::new(input),
170170
}.run(start, end);
171171

172-
type Captures = [Option<uint>, ..$num_cap_locs];
172+
type Captures = [Option<uint>; $num_cap_locs];
173173

174174
struct Nfa<'t> {
175175
which: MatchKind,
@@ -250,8 +250,8 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,
250250

251251
struct Threads {
252252
which: MatchKind,
253-
queue: [Thread, ..$num_insts],
254-
sparse: [uint, ..$num_insts],
253+
queue: [Thread; $num_insts],
254+
sparse: [uint; $num_insts],
255255
size: uint,
256256
}
257257

src/librustc_trans/trans/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
547547
// Small vector optimization. This should catch 100% of the cases that
548548
// we care about.
549549
if ixs.len() < 16 {
550-
let mut small_vec = [ C_i32(self.ccx, 0), ..16 ];
550+
let mut small_vec = [ C_i32(self.ccx, 0); 16 ];
551551
for (small_vec_e, &ix) in small_vec.iter_mut().zip(ixs.iter()) {
552552
*small_vec_e = C_i32(self.ccx, ix as i32);
553553
}

0 commit comments

Comments
 (0)