diff --git a/src/doc/guide.md b/src/doc/guide.md index 289587b9ded..f4ec787a794 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -1617,7 +1617,7 @@ value. In this example, each element of `a` will be initialized to `0i`: let a = [0i; 20]; // a: [int; 20] ``` -Arrays have type `[T,..N]`. We'll talk about this `T` notation later, when we +Arrays have type `[T; N]`. We'll talk about this `T` notation later, when we cover generics. You can get the number of elements in an array `a` with `a.len()`, and use diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 5f72fc69639..61111d96bd0 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -382,7 +382,7 @@ pub trait SliceExt for Sized? { fn get_mut(&mut self, index: uint) -> Option<&mut T>; /// Work with `self` as a mut slice. - /// Primarily intended for getting a &mut [T] from a [T, ..N]. + /// Primarily intended for getting a &mut [T] from a [T; N]. #[stable] fn as_mut_slice(&mut self) -> &mut [T]; @@ -2060,7 +2060,7 @@ mod tests { } // shouldn't panic - let mut v: [uint, .. 0] = []; + let mut v: [uint; 0] = []; v.sort(); let mut v = [0xDEADBEEFu]; @@ -2072,7 +2072,7 @@ mod tests { fn test_sort_stability() { for len in range(4i, 25) { for _ in range(0u, 10) { - let mut counts = [0i, .. 10]; + let mut counts = [0i; 10]; // create a vector like [(6, 1), (5, 1), (6, 2), ...], // where the first item of each tuple is random, but diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 7caeb563db7..129ba77d9f7 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -2743,7 +2743,7 @@ mod tests { use core::iter::order; // official Unicode test data // from http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt - let test_same: [(_, &[_]), .. 325] = [ + let test_same: [(_, &[_]); 325] = [ ("\u{20}\u{20}", &["\u{20}", "\u{20}"]), ("\u{20}\u{308}\u{20}", &["\u{20}\u{308}", "\u{20}"]), ("\u{20}\u{D}", &["\u{20}", "\u{D}"]), @@ -3075,7 +3075,7 @@ mod tests { ("\u{646}\u{200D}\u{20}", &["\u{646}\u{200D}", "\u{20}"]), ]; - let test_diff: [(_, &[_], &[_]), .. 23] = [ + let test_diff: [(_, &[_], &[_]); 23] = [ ("\u{20}\u{903}", &["\u{20}\u{903}"], &["\u{20}", "\u{903}"]), ("\u{20}\u{308}\u{903}", &["\u{20}\u{308}\u{903}"], &["\u{20}\u{308}", "\u{903}"]), ("\u{D}\u{308}\u{903}", &["\u{D}", "\u{308}\u{903}"], &["\u{D}", "\u{308}", "\u{903}"]), ("\u{A}\u{308}\u{903}", diff --git a/src/libcore/array.rs b/src/libcore/array.rs index 88e23377046..28563a60b61 100644 --- a/src/libcore/array.rs +++ b/src/libcore/array.rs @@ -26,33 +26,33 @@ macro_rules! array_impls { ($($N:expr)+) => { $( #[stable] - impl Clone for [T, ..$N] { - fn clone(&self) -> [T, ..$N] { + impl Clone for [T; $N] { + fn clone(&self) -> [T; $N] { *self } } #[unstable = "waiting for Show to stabilize"] - impl fmt::Show for [T, ..$N] { + impl fmt::Show for [T; $N] { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Show::fmt(&self[], f) } } #[stable] - impl PartialEq<[B, ..$N]> for [A, ..$N] where A: PartialEq { + impl PartialEq<[B; $N]> for [A; $N] where A: PartialEq { #[inline] - fn eq(&self, other: &[B, ..$N]) -> bool { + fn eq(&self, other: &[B; $N]) -> bool { self[] == other[] } #[inline] - fn ne(&self, other: &[B, ..$N]) -> bool { + fn ne(&self, other: &[B; $N]) -> bool { self[] != other[] } } #[stable] - impl<'a, A, B, Rhs> PartialEq for [A, ..$N] where + impl<'a, A, B, Rhs> PartialEq for [A; $N] where A: PartialEq, Rhs: Deref<[B]>, { @@ -63,47 +63,47 @@ macro_rules! array_impls { } #[stable] - impl<'a, A, B, Lhs> PartialEq<[B, ..$N]> for Lhs where + impl<'a, A, B, Lhs> PartialEq<[B; $N]> for Lhs where A: PartialEq, Lhs: Deref<[A]> { #[inline(always)] - fn eq(&self, other: &[B, ..$N]) -> bool { PartialEq::eq(&**self, other[]) } + fn eq(&self, other: &[B; $N]) -> bool { PartialEq::eq(&**self, other[]) } #[inline(always)] - fn ne(&self, other: &[B, ..$N]) -> bool { PartialEq::ne(&**self, other[]) } + fn ne(&self, other: &[B; $N]) -> bool { PartialEq::ne(&**self, other[]) } } #[stable] - impl Eq for [T, ..$N] { } + impl Eq for [T; $N] { } #[stable] - impl PartialOrd for [T, ..$N] { + impl PartialOrd for [T; $N] { #[inline] - fn partial_cmp(&self, other: &[T, ..$N]) -> Option { + fn partial_cmp(&self, other: &[T; $N]) -> Option { PartialOrd::partial_cmp(&self[], &other[]) } #[inline] - fn lt(&self, other: &[T, ..$N]) -> bool { + fn lt(&self, other: &[T; $N]) -> bool { PartialOrd::lt(&self[], &other[]) } #[inline] - fn le(&self, other: &[T, ..$N]) -> bool { + fn le(&self, other: &[T; $N]) -> bool { PartialOrd::le(&self[], &other[]) } #[inline] - fn ge(&self, other: &[T, ..$N]) -> bool { + fn ge(&self, other: &[T; $N]) -> bool { PartialOrd::ge(&self[], &other[]) } #[inline] - fn gt(&self, other: &[T, ..$N]) -> bool { + fn gt(&self, other: &[T; $N]) -> bool { PartialOrd::gt(&self[], &other[]) } } #[stable] - impl Ord for [T, ..$N] { + impl Ord for [T; $N] { #[inline] - fn cmp(&self, other: &[T, ..$N]) -> Ordering { + fn cmp(&self, other: &[T; $N]) -> Ordering { Ord::cmp(&self[], &other[]) } } diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index c1aa605a455..d4d241752f2 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -100,7 +100,7 @@ macro_rules! impl_hash { impl Hash for $ty { #[inline] fn hash(&self, state: &mut S) { - let a: [u8, ..::$ty::BYTES] = unsafe { + let a: [u8; ::$ty::BYTES] = unsafe { mem::transmute((*self as $uty).to_le() as $ty) }; state.write(a.as_slice()) diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index ad8895924f9..9faaedc45f3 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -1632,7 +1632,7 @@ pub mod types { #[repr(C)] #[deriving(Copy)] pub struct WSAPROTOCOLCHAIN { pub ChainLen: c_int, - pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN as uint], + pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as uint], } pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN; @@ -1658,7 +1658,7 @@ pub mod types { pub iSecurityScheme: c_int, pub dwMessageSize: DWORD, pub dwProviderReserved: DWORD, - pub szProtocol: [u8, ..(WSAPROTOCOL_LEN as uint) + 1u], + pub szProtocol: [u8; (WSAPROTOCOL_LEN as uint) + 1u], } pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO; diff --git a/src/librand/chacha.rs b/src/librand/chacha.rs index 0cf9ce85108..49577cd279b 100644 --- a/src/librand/chacha.rs +++ b/src/librand/chacha.rs @@ -31,14 +31,14 @@ const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of #[deriving(Copy)] pub struct ChaChaRng { - buffer: [u32, ..STATE_WORDS], // Internal buffer of output - state: [u32, ..STATE_WORDS], // Initial state + buffer: [u32; STATE_WORDS], // Internal buffer of output + state: [u32; STATE_WORDS], // Initial state index: uint, // Index into state } static EMPTY: ChaChaRng = ChaChaRng { - buffer: [0, ..STATE_WORDS], - state: [0, ..STATE_WORDS], + buffer: [0; STATE_WORDS], + state: [0; STATE_WORDS], index: STATE_WORDS }; @@ -68,7 +68,7 @@ macro_rules! double_round{ } #[inline] -fn core(output: &mut [u32, ..STATE_WORDS], input: &[u32, ..STATE_WORDS]) { +fn core(output: &mut [u32; STATE_WORDS], input: &[u32; STATE_WORDS]) { *output = *input; for _ in range(0, CHACHA_ROUNDS / 2) { @@ -86,7 +86,7 @@ impl ChaChaRng { /// fixed key of 8 zero words. pub fn new_unseeded() -> ChaChaRng { let mut rng = EMPTY; - rng.init(&[0, ..KEY_WORDS]); + rng.init(&[0; KEY_WORDS]); rng } @@ -124,7 +124,7 @@ impl ChaChaRng { /// ``` /// [1]: Daniel J. Bernstein. [*Extending the Salsa20 /// nonce.*](http://cr.yp.to/papers.html#xsalsa) - fn init(&mut self, key: &[u32, ..KEY_WORDS]) { + fn init(&mut self, key: &[u32; KEY_WORDS]) { self.state[0] = 0x61707865; self.state[1] = 0x3320646E; self.state[2] = 0x79622D32; @@ -174,7 +174,7 @@ impl<'a> SeedableRng<&'a [u32]> for ChaChaRng { fn reseed(&mut self, seed: &'a [u32]) { // reset state - self.init(&[0u32, ..KEY_WORDS]); + self.init(&[0u32; KEY_WORDS]); // set key in place let key = self.state.slice_mut(4, 4+KEY_WORDS); for (k, s) in key.iter_mut().zip(seed.iter()) { @@ -195,7 +195,7 @@ impl<'a> SeedableRng<&'a [u32]> for ChaChaRng { impl Rand for ChaChaRng { fn rand(other: &mut R) -> ChaChaRng { - let mut key : [u32, ..KEY_WORDS] = [0, ..KEY_WORDS]; + let mut key : [u32; KEY_WORDS] = [0; KEY_WORDS]; for word in key.iter_mut() { *word = other.gen(); } diff --git a/src/librand/distributions/ziggurat_tables.rs b/src/librand/distributions/ziggurat_tables.rs index 049ef3dbb59..a108fd70d1c 100644 --- a/src/librand/distributions/ziggurat_tables.rs +++ b/src/librand/distributions/ziggurat_tables.rs @@ -11,9 +11,9 @@ // Tables for distributions which are sampled using the ziggurat // algorithm. Autogenerated by `ziggurat_tables.py`. -pub type ZigTable = &'static [f64, .. 257]; +pub type ZigTable = &'static [f64; 257]; pub static ZIG_NORM_R: f64 = 3.654152885361008796; -pub static ZIG_NORM_X: [f64, .. 257] = +pub static ZIG_NORM_X: [f64; 257] = [3.910757959537090045, 3.654152885361008796, 3.449278298560964462, 3.320244733839166074, 3.224575052047029100, 3.147889289517149969, 3.083526132001233044, 3.027837791768635434, 2.978603279880844834, 2.934366867207854224, 2.894121053612348060, 2.857138730872132548, @@ -79,7 +79,7 @@ pub static ZIG_NORM_X: [f64, .. 257] = 0.487443966121754335, 0.463634336771763245, 0.437518402186662658, 0.408389134588000746, 0.375121332850465727, 0.335737519180459465, 0.286174591747260509, 0.215241895913273806, 0.000000000000000000]; -pub static ZIG_NORM_F: [f64, .. 257] = +pub static ZIG_NORM_F: [f64; 257] = [0.000477467764586655, 0.001260285930498598, 0.002609072746106363, 0.004037972593371872, 0.005522403299264754, 0.007050875471392110, 0.008616582769422917, 0.010214971439731100, 0.011842757857943104, 0.013497450601780807, 0.015177088307982072, 0.016880083152595839, @@ -146,7 +146,7 @@ pub static ZIG_NORM_F: [f64, .. 257] = 0.932060075968990209, 0.945198953453078028, 0.959879091812415930, 0.977101701282731328, 1.000000000000000000]; pub static ZIG_EXP_R: f64 = 7.697117470131050077; -pub static ZIG_EXP_X: [f64, .. 257] = +pub static ZIG_EXP_X: [f64; 257] = [8.697117470131052741, 7.697117470131050077, 6.941033629377212577, 6.478378493832569696, 6.144164665772472667, 5.882144315795399869, 5.666410167454033697, 5.482890627526062488, 5.323090505754398016, 5.181487281301500047, 5.054288489981304089, 4.938777085901250530, @@ -212,7 +212,7 @@ pub static ZIG_EXP_X: [f64, .. 257] = 0.253658363385912022, 0.233790483059674731, 0.212671510630966620, 0.189958689622431842, 0.165127622564187282, 0.137304980940012589, 0.104838507565818778, 0.063852163815001570, 0.000000000000000000]; -pub static ZIG_EXP_F: [f64, .. 257] = +pub static ZIG_EXP_F: [f64; 257] = [0.000167066692307963, 0.000454134353841497, 0.000967269282327174, 0.001536299780301573, 0.002145967743718907, 0.002788798793574076, 0.003460264777836904, 0.004157295120833797, 0.004877655983542396, 0.005619642207205489, 0.006381905937319183, 0.007163353183634991, diff --git a/src/librand/isaac.rs b/src/librand/isaac.rs index a76e5ebd08a..1fe435a59ad 100644 --- a/src/librand/isaac.rs +++ b/src/librand/isaac.rs @@ -32,8 +32,8 @@ const RAND_SIZE_UINT: uint = 1 << (RAND_SIZE_LEN as uint); #[deriving(Copy)] pub struct IsaacRng { cnt: u32, - rsl: [u32, ..RAND_SIZE_UINT], - mem: [u32, ..RAND_SIZE_UINT], + rsl: [u32; RAND_SIZE_UINT], + mem: [u32; RAND_SIZE_UINT], a: u32, b: u32, c: u32 @@ -41,8 +41,8 @@ pub struct IsaacRng { static EMPTY: IsaacRng = IsaacRng { cnt: 0, - rsl: [0, ..RAND_SIZE_UINT], - mem: [0, ..RAND_SIZE_UINT], + rsl: [0; RAND_SIZE_UINT], + mem: [0; RAND_SIZE_UINT], a: 0, b: 0, c: 0 }; @@ -267,8 +267,8 @@ const RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN; #[deriving(Copy)] pub struct Isaac64Rng { cnt: uint, - rsl: [u64, .. RAND_SIZE_64], - mem: [u64, .. RAND_SIZE_64], + rsl: [u64; RAND_SIZE_64], + mem: [u64; RAND_SIZE_64], a: u64, b: u64, c: u64, @@ -276,8 +276,8 @@ pub struct Isaac64Rng { static EMPTY_64: Isaac64Rng = Isaac64Rng { cnt: 0, - rsl: [0, .. RAND_SIZE_64], - mem: [0, .. RAND_SIZE_64], + rsl: [0; RAND_SIZE_64], + mem: [0; RAND_SIZE_64], a: 0, b: 0, c: 0, }; @@ -358,7 +358,7 @@ impl Isaac64Rng { let mut a = self.a; let mut b = self.b + self.c; const MIDPOINT: uint = RAND_SIZE_64 / 2; - const MP_VEC: [(uint, uint), .. 2] = [(0,MIDPOINT), (MIDPOINT, 0)]; + const MP_VEC: [(uint, uint); 2] = [(0,MIDPOINT), (MIDPOINT, 0)]; macro_rules! ind ( ($x:expr) => { *self.mem.get_unchecked(($x as uint >> 3) & (RAND_SIZE_64 - 1)) diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 59f86db73c9..568d2459118 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -140,7 +140,7 @@ pub trait Rng { /// ```rust /// use std::rand::{thread_rng, Rng}; /// - /// let mut v = [0u8, .. 13579]; + /// let mut v = [0u8; 13579]; /// thread_rng().fill_bytes(&mut v); /// println!("{}", v.as_slice()); /// ``` @@ -429,9 +429,9 @@ impl Rng for XorShiftRng { } } -impl SeedableRng<[u32, .. 4]> for XorShiftRng { +impl SeedableRng<[u32; 4]> for XorShiftRng { /// Reseed an XorShiftRng. This will panic if `seed` is entirely 0. - fn reseed(&mut self, seed: [u32, .. 4]) { + fn reseed(&mut self, seed: [u32; 4]) { assert!(!seed.iter().all(|&x| x == 0), "XorShiftRng.reseed called with an all zero seed."); @@ -442,7 +442,7 @@ impl SeedableRng<[u32, .. 4]> for XorShiftRng { } /// Create a new XorShiftRng. This will panic if `seed` is entirely 0. - fn from_seed(seed: [u32, .. 4]) -> XorShiftRng { + fn from_seed(seed: [u32; 4]) -> XorShiftRng { assert!(!seed.iter().all(|&x| x == 0), "XorShiftRng::from_seed called with an all zero seed."); diff --git a/src/libregex_macros/lib.rs b/src/libregex_macros/lib.rs index bf1095d21b2..0baa5e6c24f 100644 --- a/src/libregex_macros/lib.rs +++ b/src/libregex_macros/lib.rs @@ -169,7 +169,7 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str, chars: CharReader::new(input), }.run(start, end); - type Captures = [Option, ..$num_cap_locs]; + type Captures = [Option; $num_cap_locs]; struct Nfa<'t> { which: MatchKind, @@ -250,8 +250,8 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str, struct Threads { which: MatchKind, - queue: [Thread, ..$num_insts], - sparse: [uint, ..$num_insts], + queue: [Thread; $num_insts], + sparse: [uint; $num_insts], size: uint, } diff --git a/src/librustc_trans/trans/builder.rs b/src/librustc_trans/trans/builder.rs index 5249f59d78f..b39dbd71117 100644 --- a/src/librustc_trans/trans/builder.rs +++ b/src/librustc_trans/trans/builder.rs @@ -547,7 +547,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // Small vector optimization. This should catch 100% of the cases that // we care about. if ixs.len() < 16 { - let mut small_vec = [ C_i32(self.ccx, 0), ..16 ]; + let mut small_vec = [ C_i32(self.ccx, 0); 16 ]; for (small_vec_e, &ix) in small_vec.iter_mut().zip(ixs.iter()) { *small_vec_e = C_i32(self.ccx, ix as i32); } diff --git a/src/librustc_trans/trans/cleanup.rs b/src/librustc_trans/trans/cleanup.rs index b4deea4c72f..8ac427dd061 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/trans/cleanup.rs @@ -63,7 +63,7 @@ pub const EXIT_MAX: uint = 2; pub enum CleanupScopeKind<'blk, 'tcx: 'blk> { CustomScopeKind, AstScopeKind(ast::NodeId), - LoopScopeKind(ast::NodeId, [Block<'blk, 'tcx>, ..EXIT_MAX]) + LoopScopeKind(ast::NodeId, [Block<'blk, 'tcx>; EXIT_MAX]) } impl<'blk, 'tcx: 'blk> fmt::Show for CleanupScopeKind<'blk, 'tcx> { @@ -146,7 +146,7 @@ impl<'blk, 'tcx> CleanupMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx> { fn push_loop_cleanup_scope(&self, id: ast::NodeId, - exits: [Block<'blk, 'tcx>, ..EXIT_MAX]) { + exits: [Block<'blk, 'tcx>; EXIT_MAX]) { debug!("push_loop_cleanup_scope({})", self.ccx.tcx().map.node_to_string(id)); assert_eq!(Some(id), self.top_ast_scope()); @@ -1058,7 +1058,7 @@ pub trait CleanupMethods<'blk, 'tcx> { fn push_ast_cleanup_scope(&self, id: NodeInfo); fn push_loop_cleanup_scope(&self, id: ast::NodeId, - exits: [Block<'blk, 'tcx>, ..EXIT_MAX]); + exits: [Block<'blk, 'tcx>; EXIT_MAX]); fn push_custom_cleanup_scope(&self) -> CustomScopeIndex; fn push_custom_cleanup_scope_with_debug_loc(&self, debug_loc: NodeInfo) diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index d88bc88dcba..8a9c2eebf3a 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -392,7 +392,7 @@ fn escape_str(writer: &mut io::Writer, v: &str) -> Result<(), io::IoError> { } fn escape_char(writer: &mut io::Writer, v: char) -> Result<(), io::IoError> { - let mut buf = [0, .. 4]; + let mut buf = [0; 4]; let len = v.encode_utf8(&mut buf).unwrap(); escape_bytes(writer, buf[mut ..len]) } diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index 4e22fc60080..46498610e56 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -454,7 +454,7 @@ unsafe fn with_c_str(v: &[u8], checked: bool, f: F) -> T where F: FnOnce(*const libc::c_char) -> T, { let c_str = if v.len() < BUF_LEN { - let mut buf: [u8, .. BUF_LEN] = mem::uninitialized(); + let mut buf: [u8; BUF_LEN] = mem::uninitialized(); slice::bytes::copy_memory(&mut buf, v); buf[v.len()] = 0; diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index f6fb7ec435f..7fa6ebc6e3b 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -882,7 +882,7 @@ mod test { } { let mut read_stream = File::open_mode(filename, Open, Read); - let mut read_buf = [0, .. 1028]; + let mut read_buf = [0; 1028]; let read_str = match check!(read_stream.read(&mut read_buf)) { -1|0 => panic!("shouldn't happen"), n => str::from_utf8(read_buf[..n]).unwrap().to_string() @@ -922,7 +922,7 @@ mod test { #[test] fn file_test_io_non_positional_read() { let message: &str = "ten-four"; - let mut read_mem = [0, .. 8]; + let mut read_mem = [0; 8]; let tmpdir = tmpdir(); let filename = &tmpdir.join("file_rt_io_file_test_positional.txt"); { @@ -948,7 +948,7 @@ mod test { #[test] fn file_test_io_seek_and_tell_smoke_test() { let message = "ten-four"; - let mut read_mem = [0, .. 4]; + let mut read_mem = [0; 4]; let set_cursor = 4 as u64; let mut tell_pos_pre_read; let mut tell_pos_post_read; @@ -978,7 +978,7 @@ mod test { let overwrite_msg = "-the-bar!!"; let final_msg = "foo-the-bar!!"; let seek_idx = 3i; - let mut read_mem = [0, .. 13]; + let mut read_mem = [0; 13]; let tmpdir = tmpdir(); let filename = &tmpdir.join("file_rt_io_file_test_seek_and_write.txt"); { @@ -1003,7 +1003,7 @@ mod test { let chunk_one: &str = "qwer"; let chunk_two: &str = "asdf"; let chunk_three: &str = "zxcv"; - let mut read_mem = [0, .. 4]; + let mut read_mem = [0; 4]; let tmpdir = tmpdir(); let filename = &tmpdir.join("file_rt_io_file_test_seek_shakedown.txt"); { @@ -1105,7 +1105,7 @@ mod test { check!(w.write(msg)); } let files = check!(readdir(dir)); - let mut mem = [0u8, .. 4]; + let mut mem = [0u8; 4]; for f in files.iter() { { let n = f.filestem_str(); @@ -1137,7 +1137,7 @@ mod test { check!(File::create(&dir2.join("14"))); let mut files = check!(walk_dir(dir)); - let mut cur = [0u8, .. 2]; + let mut cur = [0u8; 2]; for f in files { let stem = f.filestem_str().unwrap(); let root = stem.as_bytes()[0] - b'0'; diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs index 9d73cae094d..f8ea373f8f4 100644 --- a/src/libstd/io/mem.rs +++ b/src/libstd/io/mem.rs @@ -725,9 +725,9 @@ mod test { { let mut rdr = MemReader::new(buf); for _i in range(0u, 10) { - let mut buf = [0 as u8, .. 10]; + let mut buf = [0 as u8; 10]; rdr.read(&mut buf).unwrap(); - assert_eq!(buf.as_slice(), [5, .. 10].as_slice()); + assert_eq!(buf.as_slice(), [5; 10].as_slice()); } } }); @@ -740,10 +740,10 @@ mod test { { let mut wr = BufWriter::new(&mut buf); for _i in range(0u, 10) { - wr.write(&[5, .. 10]).unwrap(); + wr.write(&[5; 10]).unwrap(); } } - assert_eq!(buf.as_slice(), [5, .. 100].as_slice()); + assert_eq!(buf.as_slice(), [5; 100].as_slice()); }); } @@ -754,9 +754,9 @@ mod test { { let mut rdr = BufReader::new(&buf); for _i in range(0u, 10) { - let mut buf = [0 as u8, .. 10]; + let mut buf = [0 as u8; 10]; rdr.read(&mut buf).unwrap(); - assert_eq!(buf, [5, .. 10]); + assert_eq!(buf, [5; 10]); } } }); diff --git a/src/libstd/io/net/pipe.rs b/src/libstd/io/net/pipe.rs index 93f37a8c98f..6ce66c3273b 100644 --- a/src/libstd/io/net/pipe.rs +++ b/src/libstd/io/net/pipe.rs @@ -672,7 +672,7 @@ mod tests { s.set_timeout(Some(20)); for i in range(0u, 1001) { - match s.write(&[0, .. 128 * 1024]) { + match s.write(&[0; 128 * 1024]) { Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {}, Err(IoError { kind: TimedOut, .. }) => break, Err(e) => panic!("{}", e), @@ -701,7 +701,7 @@ mod tests { rx.recv(); let mut amt = 0; while amt < 100 * 128 * 1024 { - match s.read(&mut [0, ..128 * 1024]) { + match s.read(&mut [0;128 * 1024]) { Ok(n) => { amt += n; } Err(e) => panic!("{}", e), } @@ -716,7 +716,7 @@ mod tests { tx.send(()); for _ in range(0u, 100) { - assert!(s.write(&[0, ..128 * 1024]).is_ok()); + assert!(s.write(&[0;128 * 1024]).is_ok()); } } @@ -735,7 +735,7 @@ mod tests { let mut s = a.accept().unwrap(); s.set_write_timeout(Some(20)); for i in range(0u, 1001) { - match s.write(&[0, .. 128 * 1024]) { + match s.write(&[0; 128 * 1024]) { Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {}, Err(IoError { kind: TimedOut, .. }) => break, Err(e) => panic!("{}", e), diff --git a/src/libstd/io/net/tcp.rs b/src/libstd/io/net/tcp.rs index 4706ab35d1d..826f492d85d 100644 --- a/src/libstd/io/net/tcp.rs +++ b/src/libstd/io/net/tcp.rs @@ -1256,7 +1256,7 @@ mod test { s.set_timeout(Some(20)); for i in range(0i, 1001) { - match s.write(&[0, .. 128 * 1024]) { + match s.write(&[0; 128 * 1024]) { Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {}, Err(IoError { kind: TimedOut, .. }) => break, Err(e) => panic!("{}", e), @@ -1280,7 +1280,7 @@ mod test { rx.recv(); let mut amt = 0; while amt < 100 * 128 * 1024 { - match s.read(&mut [0, ..128 * 1024]) { + match s.read(&mut [0;128 * 1024]) { Ok(n) => { amt += n; } Err(e) => panic!("{}", e), } @@ -1295,7 +1295,7 @@ mod test { tx.send(()); for _ in range(0i, 100) { - assert!(s.write(&[0, ..128 * 1024]).is_ok()); + assert!(s.write(&[0;128 * 1024]).is_ok()); } } @@ -1314,7 +1314,7 @@ mod test { let mut s = a.accept().unwrap(); s.set_write_timeout(Some(20)); for i in range(0i, 1001) { - match s.write(&[0, .. 128 * 1024]) { + match s.write(&[0; 128 * 1024]) { Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {}, Err(IoError { kind: TimedOut, .. }) => break, Err(e) => panic!("{}", e), diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index 62868afa00a..11c2f956c35 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -599,7 +599,7 @@ mod test { a.set_write_timeout(Some(1000)); for _ in range(0u, 100) { - match a.send_to(&[0, ..4*1024], addr2) { + match a.send_to(&[0;4*1024], addr2) { Ok(()) | Err(IoError { kind: ShortWrite(..), .. }) => {}, Err(IoError { kind: TimedOut, .. }) => break, Err(e) => panic!("other error: {}", e), diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index f88e8d7e7e3..9840412160d 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -235,7 +235,7 @@ impl Reader for TeeReader { /// Copies all data from a `Reader` to a `Writer`. pub fn copy(r: &mut R, w: &mut W) -> io::IoResult<()> { - let mut buf = [0, ..super::DEFAULT_BUF_SIZE]; + let mut buf = [0; super::DEFAULT_BUF_SIZE]; loop { let len = match r.read(&mut buf) { Ok(len) => len, diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index d4f72a53aec..f665d150f38 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -669,7 +669,7 @@ mod bench { #[bench] fn rand_shuffle_100(b: &mut Bencher) { let mut rng = weak_rng(); - let x : &mut[uint] = &mut [1,..100]; + let x : &mut[uint] = &mut [1; 100]; b.iter(|| { rng.shuffle(x); }) diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index 3b3e9ae6275..ca36f2d8997 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -217,12 +217,12 @@ mod imp { impl Rng for OsRng { fn next_u32(&mut self) -> u32 { - let mut v = [0u8, .. 4]; + let mut v = [0u8; 4]; self.fill_bytes(&mut v); unsafe { mem::transmute(v) } } fn next_u64(&mut self) -> u64 { - let mut v = [0u8, .. 8]; + let mut v = [0u8; 8]; self.fill_bytes(&mut v); unsafe { mem::transmute(v) } } @@ -304,12 +304,12 @@ mod imp { impl Rng for OsRng { fn next_u32(&mut self) -> u32 { - let mut v = [0u8, .. 4]; + let mut v = [0u8; 4]; self.fill_bytes(&mut v); unsafe { mem::transmute(v) } } fn next_u64(&mut self) -> u64 { - let mut v = [0u8, .. 8]; + let mut v = [0u8; 8]; self.fill_bytes(&mut v); unsafe { mem::transmute(v) } } @@ -351,7 +351,7 @@ mod test { r.next_u32(); r.next_u64(); - let mut v = [0u8, .. 1000]; + let mut v = [0u8; 1000]; r.fill_bytes(&mut v); } @@ -371,7 +371,7 @@ mod test { // as possible (XXX: is this a good test?) let mut r = OsRng::new().unwrap(); Thread::yield_now(); - let mut v = [0u8, .. 1000]; + let mut v = [0u8; 1000]; for _ in range(0u, 100) { r.next_u32(); diff --git a/src/libstd/rand/reader.rs b/src/libstd/rand/reader.rs index 7298b2ef0ac..15e63aa19ea 100644 --- a/src/libstd/rand/reader.rs +++ b/src/libstd/rand/reader.rs @@ -105,7 +105,7 @@ mod test { #[test] fn test_reader_rng_fill_bytes() { let v = [1u8, 2, 3, 4, 5, 6, 7, 8]; - let mut w = [0u8, .. 8]; + let mut w = [0u8; 8]; let mut rng = ReaderRng::new(MemReader::new(v.as_slice().to_vec())); rng.fill_bytes(&mut w); @@ -117,7 +117,7 @@ mod test { #[should_fail] fn test_reader_rng_insufficient_bytes() { let mut rng = ReaderRng::new(MemReader::new(vec!())); - let mut v = [0u8, .. 3]; + let mut v = [0u8; 3]; rng.fill_bytes(&mut v); } } diff --git a/src/libstd/rt/libunwind.rs b/src/libstd/rt/libunwind.rs index 2feea7fa0a4..4dbe878277d 100644 --- a/src/libstd/rt/libunwind.rs +++ b/src/libstd/rt/libunwind.rs @@ -82,7 +82,7 @@ pub const unwinder_private_data_size: uint = 2; pub struct _Unwind_Exception { pub exception_class: _Unwind_Exception_Class, pub exception_cleanup: _Unwind_Exception_Cleanup_Fn, - pub private: [_Unwind_Word, ..unwinder_private_data_size], + pub private: [_Unwind_Word; unwinder_private_data_size], } pub enum _Unwind_Context {} diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index c273c52dacc..e0c512706e6 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -83,7 +83,7 @@ pub type Callback = fn(msg: &(Any + Send), file: &'static str, line: uint); // // For more information, see below. const MAX_CALLBACKS: uint = 16; -static CALLBACKS: [atomic::AtomicUint, ..MAX_CALLBACKS] = +static CALLBACKS: [atomic::AtomicUint; MAX_CALLBACKS] = [atomic::INIT_ATOMIC_UINT, atomic::INIT_ATOMIC_UINT, atomic::INIT_ATOMIC_UINT, atomic::INIT_ATOMIC_UINT, atomic::INIT_ATOMIC_UINT, atomic::INIT_ATOMIC_UINT, @@ -168,7 +168,7 @@ fn rust_panic(cause: Box) -> ! { uwe: uw::_Unwind_Exception { exception_class: rust_exception_class(), exception_cleanup: exception_cleanup, - private: [0, ..uw::unwinder_private_data_size], + private: [0; uw::unwinder_private_data_size], }, cause: Some(cause), }; diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 87ec20fbef8..259c15b5f06 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -310,7 +310,7 @@ pub fn get_address_name(addr: IpAddr) -> Result { let mut storage: libc::sockaddr_storage = unsafe { mem::zeroed() }; let len = addr_to_sockaddr(addr, &mut storage); - let mut hostbuf = [0 as c_char, ..NI_MAXHOST]; + let mut hostbuf = [0 as c_char; NI_MAXHOST]; let res = unsafe { getnameinfo(&storage as *const _ as *const libc::sockaddr, len, diff --git a/src/libstd/sys/unix/c.rs b/src/libstd/sys/unix/c.rs index 417f1bf7602..1bb8ed78177 100644 --- a/src/libstd/sys/unix/c.rs +++ b/src/libstd/sys/unix/c.rs @@ -94,7 +94,7 @@ mod select { #[repr(C)] pub struct fd_set { - fds_bits: [i32, ..(FD_SETSIZE / 32)] + fds_bits: [i32; (FD_SETSIZE / 32)] } pub fn fd_set(set: &mut fd_set, fd: i32) { @@ -115,7 +115,7 @@ mod select { #[repr(C)] pub struct fd_set { // FIXME: shouldn't this be a c_ulong? - fds_bits: [libc::uintptr_t, ..(FD_SETSIZE / uint::BITS)] + fds_bits: [libc::uintptr_t; (FD_SETSIZE / uint::BITS)] } pub fn fd_set(set: &mut fd_set, fd: i32) { diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 624d61cd41f..595191db3b2 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -100,7 +100,7 @@ pub fn error_string(errno: i32) -> String { } } - let mut buf = [0 as c_char, ..TMPBUF_SZ]; + let mut buf = [0 as c_char; TMPBUF_SZ]; let p = buf.as_mut_ptr(); unsafe { @@ -124,7 +124,7 @@ pub unsafe fn pipe() -> IoResult<(FileDesc, FileDesc)> { pub fn getcwd() -> IoResult { use c_str::CString; - let mut buf = [0 as c_char, ..BUF_BYTES]; + let mut buf = [0 as c_char; BUF_BYTES]; unsafe { if libc::getcwd(buf.as_mut_ptr(), buf.len() as libc::size_t).is_null() { Err(IoError::last_error()) diff --git a/src/libstd/sys/unix/sync.rs b/src/libstd/sys/unix/sync.rs index 8b62def62b6..77c5582d8a4 100644 --- a/src/libstd/sys/unix/sync.rs +++ b/src/libstd/sys/unix/sync.rs @@ -86,30 +86,30 @@ mod os { #[repr(C)] pub struct pthread_mutex_t { __sig: libc::c_long, - __opaque: [u8, ..__PTHREAD_MUTEX_SIZE__], + __opaque: [u8; __PTHREAD_MUTEX_SIZE__], } #[repr(C)] pub struct pthread_cond_t { __sig: libc::c_long, - __opaque: [u8, ..__PTHREAD_COND_SIZE__], + __opaque: [u8; __PTHREAD_COND_SIZE__], } #[repr(C)] pub struct pthread_rwlock_t { __sig: libc::c_long, - __opaque: [u8, ..__PTHREAD_RWLOCK_SIZE__], + __opaque: [u8; __PTHREAD_RWLOCK_SIZE__], } pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { __sig: _PTHREAD_MUTEX_SIG_INIT, - __opaque: [0, ..__PTHREAD_MUTEX_SIZE__], + __opaque: [0; __PTHREAD_MUTEX_SIZE__], }; pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { __sig: _PTHREAD_COND_SIG_INIT, - __opaque: [0, ..__PTHREAD_COND_SIZE__], + __opaque: [0; __PTHREAD_COND_SIZE__], }; pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { __sig: _PTHREAD_RWLOCK_SIG_INIT, - __opaque: [0, ..__PTHREAD_RWLOCK_SIZE__], + __opaque: [0; __PTHREAD_RWLOCK_SIZE__], }; } @@ -145,30 +145,30 @@ mod os { #[repr(C)] pub struct pthread_mutex_t { __align: libc::c_longlong, - size: [u8, ..__SIZEOF_PTHREAD_MUTEX_T], + size: [u8; __SIZEOF_PTHREAD_MUTEX_T], } #[repr(C)] pub struct pthread_cond_t { __align: libc::c_longlong, - size: [u8, ..__SIZEOF_PTHREAD_COND_T], + size: [u8; __SIZEOF_PTHREAD_COND_T], } #[repr(C)] pub struct pthread_rwlock_t { __align: libc::c_longlong, - size: [u8, ..__SIZEOF_PTHREAD_RWLOCK_T], + size: [u8; __SIZEOF_PTHREAD_RWLOCK_T], } pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { __align: 0, - size: [0, ..__SIZEOF_PTHREAD_MUTEX_T], + size: [0; __SIZEOF_PTHREAD_MUTEX_T], }; pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { __align: 0, - size: [0, ..__SIZEOF_PTHREAD_COND_T], + size: [0; __SIZEOF_PTHREAD_COND_T], }; pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { __align: 0, - size: [0, ..__SIZEOF_PTHREAD_RWLOCK_T], + size: [0; __SIZEOF_PTHREAD_RWLOCK_T], }; } #[cfg(target_os = "android")] diff --git a/src/libstd/sys/windows/backtrace.rs b/src/libstd/sys/windows/backtrace.rs index 4f45831cb3a..319a458087b 100644 --- a/src/libstd/sys/windows/backtrace.rs +++ b/src/libstd/sys/windows/backtrace.rs @@ -83,7 +83,7 @@ struct SYMBOL_INFO { // note that windows has this as 1, but it basically just means that // the name is inline at the end of the struct. For us, we just bump // the struct size up to MAX_SYM_NAME. - Name: [libc::c_char, ..MAX_SYM_NAME], + Name: [libc::c_char; MAX_SYM_NAME], } @@ -162,7 +162,7 @@ mod arch { EFlags: libc::DWORD, Esp: libc::DWORD, SegSs: libc::DWORD, - ExtendedRegisters: [u8, ..MAXIMUM_SUPPORTED_EXTENSION], + ExtendedRegisters: [u8; MAXIMUM_SUPPORTED_EXTENSION], } #[repr(C)] @@ -245,7 +245,7 @@ mod arch { FltSave: FLOATING_SAVE_AREA, - VectorRegister: [M128A, .. 26], + VectorRegister: [M128A; 26], VectorControl: DWORDLONG, DebugControl: DWORDLONG, diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs index 06259d61fcb..6cccefbe890 100644 --- a/src/libstd/sys/windows/c.rs +++ b/src/libstd/sys/windows/c.rs @@ -43,8 +43,8 @@ pub const WSA_WAIT_FAILED: libc::DWORD = libc::consts::os::extra::WAIT_FAILED; pub struct WSADATA { pub wVersion: libc::WORD, pub wHighVersion: libc::WORD, - pub szDescription: [u8, ..WSADESCRIPTION_LEN + 1], - pub szSystemStatus: [u8, ..WSASYS_STATUS_LEN + 1], + pub szDescription: [u8; WSADESCRIPTION_LEN + 1], + pub szSystemStatus: [u8; WSASYS_STATUS_LEN + 1], pub iMaxSockets: u16, pub iMaxUdpDg: u16, pub lpVendorInfo: *mut u8, @@ -57,8 +57,8 @@ pub struct WSADATA { pub iMaxSockets: u16, pub iMaxUdpDg: u16, pub lpVendorInfo: *mut u8, - pub szDescription: [u8, ..WSADESCRIPTION_LEN + 1], - pub szSystemStatus: [u8, ..WSASYS_STATUS_LEN + 1], + pub szDescription: [u8; WSADESCRIPTION_LEN + 1], + pub szSystemStatus: [u8; WSASYS_STATUS_LEN + 1], } pub type LPWSADATA = *mut WSADATA; @@ -66,7 +66,7 @@ pub type LPWSADATA = *mut WSADATA; #[repr(C)] pub struct WSANETWORKEVENTS { pub lNetworkEvents: libc::c_long, - pub iErrorCode: [libc::c_int, ..FD_MAX_EVENTS], + pub iErrorCode: [libc::c_int; FD_MAX_EVENTS], } pub type LPWSANETWORKEVENTS = *mut WSANETWORKEVENTS; @@ -76,7 +76,7 @@ pub type WSAEVENT = libc::HANDLE; #[repr(C)] pub struct fd_set { fd_count: libc::c_uint, - fd_array: [libc::SOCKET, ..FD_SETSIZE], + fd_array: [libc::SOCKET; FD_SETSIZE], } pub fn fd_set(set: &mut fd_set, s: libc::SOCKET) { diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs index 127d4f99622..09003f87ff0 100644 --- a/src/libstd/sys/windows/os.rs +++ b/src/libstd/sys/windows/os.rs @@ -80,7 +80,7 @@ pub fn error_string(errnum: i32) -> String { // MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT) let langId = 0x0800 as DWORD; - let mut buf = [0 as WCHAR, ..TMPBUF_SZ]; + let mut buf = [0 as WCHAR; TMPBUF_SZ]; unsafe { let res = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | @@ -164,7 +164,7 @@ pub fn getcwd() -> IoResult { use libc::GetCurrentDirectoryW; use io::OtherIoError; - let mut buf = [0 as u16, ..BUF_BYTES]; + let mut buf = [0 as u16; BUF_BYTES]; unsafe { if libc::GetCurrentDirectoryW(buf.len() as DWORD, buf.as_mut_ptr()) == 0 as DWORD { return Err(IoError::last_error()); diff --git a/src/libstd/sys/windows/stack_overflow.rs b/src/libstd/sys/windows/stack_overflow.rs index bdf2e0bccb1..e8b447022cb 100644 --- a/src/libstd/sys/windows/stack_overflow.rs +++ b/src/libstd/sys/windows/stack_overflow.rs @@ -90,7 +90,7 @@ pub struct EXCEPTION_RECORD { pub ExceptionRecord: *mut EXCEPTION_RECORD, pub ExceptionAddress: LPVOID, pub NumberParameters: DWORD, - pub ExceptionInformation: [LPVOID, ..EXCEPTION_MAXIMUM_PARAMETERS] + pub ExceptionInformation: [LPVOID; EXCEPTION_MAXIMUM_PARAMETERS] } pub struct EXCEPTION_POINTERS { diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs index 90fc28014e6..720a907fe77 100644 --- a/src/libsyntax/diagnostics/plugin.rs +++ b/src/libsyntax/diagnostics/plugin.rs @@ -119,6 +119,6 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt, }); MacItems::new(vec![quote_item!(ecx, - pub static $name: [(&'static str, &'static str), ..$count] = $expr; + pub static $name: [(&'static str, &'static str); $count] = $expr; ).unwrap()].into_iter()) } diff --git a/src/test/compile-fail/array-old-syntax-1.rs b/src/test/compile-fail/array-old-syntax-1.rs index 33178fe8105..3c01a7756a6 100644 --- a/src/test/compile-fail/array-old-syntax-1.rs +++ b/src/test/compile-fail/array-old-syntax-1.rs @@ -11,5 +11,5 @@ // Test that the old fixed length array syntax is a parsing error. fn main() { - let _x: [int, ..3] = [0i, 1, 2]; //~ ERROR + let _x: [int, ..3] = [0i, 1, 2]; //~ ERROR } diff --git a/src/test/compile-fail/better-expected.rs b/src/test/compile-fail/better-expected.rs index 2e0f2a174c6..672d8a30fc5 100644 --- a/src/test/compile-fail/better-expected.rs +++ b/src/test/compile-fail/better-expected.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - let x: [int 3]; //~ ERROR expected one of `(`, `+`, `,`, `::`, `;`, or `]`, found `3` + let x: [int 3]; //~ ERROR expected one of `(`, `+`, `::`, `;`, or `]`, found `3` } diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/compile-fail/issue-17913.rs index 81f9ed991eb..3224edb381c 100644 --- a/src/test/compile-fail/issue-17913.rs +++ b/src/test/compile-fail/issue-17913.rs @@ -13,13 +13,13 @@ #[cfg(target_word_size = "64")] fn main() { let n = 0u; - let a = box [&n,..0xF000000000000000u]; + let a = box [&n; 0xF000000000000000u]; println!("{}", a[0xFFFFFFu]); } #[cfg(target_word_size = "32")] fn main() { let n = 0u; - let a = box [&n,..0xFFFFFFFFu]; + let a = box [&n; 0xFFFFFFFFu]; println!("{}", a[0xFFFFFFu]); } diff --git a/src/test/compile-fail/issue-6977.rs b/src/test/compile-fail/issue-6977.rs index d0ff116b42f..c2bd810abad 100644 --- a/src/test/compile-fail/issue-6977.rs +++ b/src/test/compile-fail/issue-6977.rs @@ -11,5 +11,5 @@ // Trying to create a fixed-length vector with a negative size fn main() { - let _x = [0,..-1]; //~ ERROR found negative integer + let _x = [0; -1]; //~ ERROR found negative integer } diff --git a/src/test/compile-fail/removed-syntax-fixed-vec.rs b/src/test/compile-fail/removed-syntax-fixed-vec.rs index 0a8420c19c3..6537e3ddd27 100644 --- a/src/test/compile-fail/removed-syntax-fixed-vec.rs +++ b/src/test/compile-fail/removed-syntax-fixed-vec.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -type v = [int * 3]; //~ ERROR expected one of `(`, `+`, `,`, `::`, `;`, or `]`, found `*` +type v = [int * 3]; //~ ERROR expected one of `(`, `+`, `::`, `;`, or `]`, found `*` diff --git a/src/test/compile-fail/removed-syntax-mut-vec-ty.rs b/src/test/compile-fail/removed-syntax-mut-vec-ty.rs index 9c6056bd72a..efde1f1b24d 100644 --- a/src/test/compile-fail/removed-syntax-mut-vec-ty.rs +++ b/src/test/compile-fail/removed-syntax-mut-vec-ty.rs @@ -10,4 +10,4 @@ type v = [mut int]; //~^ ERROR expected identifier, found keyword `mut` - //~^^ ERROR expected one of `(`, `+`, `,`, `::`, `;`, or `]`, found `int` + //~^^ ERROR expected one of `(`, `+`, `::`, `;`, or `]`, found `int` diff --git a/src/test/pretty/issue-4264.rs b/src/test/pretty/issue-4264.rs index 84c592defaa..b481e109e1a 100644 --- a/src/test/pretty/issue-4264.rs +++ b/src/test/pretty/issue-4264.rs @@ -20,29 +20,29 @@ pub fn bar() { const FOO: uint = 5u - 4u; let _: [(); FOO] = [()]; - let _ : [(), ..1u] = [()]; + let _ : [(); 1u] = [()]; - let _ = &([1i,2,3]) as *const _ as *const [int, ..3u]; + let _ = &([1i,2,3]) as *const _ as *const [int; 3u]; format!("test"); } -pub type Foo = [int, ..3u]; +pub type Foo = [int; 3u]; pub struct Bar { - pub x: [int, ..3u] + pub x: [int; 3u] } -pub struct TupleBar([int, ..4u]); +pub struct TupleBar([int; 4u]); pub enum Baz { - BazVariant([int, ..5u]) + BazVariant([int; 5u]) } pub fn id(x: T) -> T { x } pub fn use_id() { - let _ = id::<[int, ..3u]>([1,2,3]); + let _ = id::<[int; 3u]>([1,2,3]); } diff --git a/src/test/run-pass/foreach-external-iterators-break.rs b/src/test/run-pass/foreach-external-iterators-break.rs index d9d3e320260..5f7770e97a9 100644 --- a/src/test/run-pass/foreach-external-iterators-break.rs +++ b/src/test/run-pass/foreach-external-iterators-break.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = [1i,..100]; + let x = [1i; 100]; let mut y = 0i; for i in x.iter() { if y > 10 { diff --git a/src/test/run-pass/foreach-external-iterators-loop.rs b/src/test/run-pass/foreach-external-iterators-loop.rs index c6c2d423927..d8c6dd6a93d 100644 --- a/src/test/run-pass/foreach-external-iterators-loop.rs +++ b/src/test/run-pass/foreach-external-iterators-loop.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = [1i,..100]; + let x = [1i; 100]; let mut y = 0i; for (n,i) in x.iter().enumerate() { if n < 10 { diff --git a/src/test/run-pass/foreach-external-iterators-nested.rs b/src/test/run-pass/foreach-external-iterators-nested.rs index f4d38dfcfc3..20ea9c440a1 100644 --- a/src/test/run-pass/foreach-external-iterators-nested.rs +++ b/src/test/run-pass/foreach-external-iterators-nested.rs @@ -9,8 +9,8 @@ // except according to those terms. pub fn main() { - let x = [1i,..100]; - let y = [2i,..100]; + let x = [1i; 100]; + let y = [2i; 100]; let mut p = 0i; let mut q = 0i; for i in x.iter() { diff --git a/src/test/run-pass/foreach-external-iterators.rs b/src/test/run-pass/foreach-external-iterators.rs index 684a9b81fb2..0ac642cc449 100644 --- a/src/test/run-pass/foreach-external-iterators.rs +++ b/src/test/run-pass/foreach-external-iterators.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = [1i,..100]; + let x = [1i; 100]; let mut y = 0i; for i in x.iter() { y += *i diff --git a/src/test/run-pass/transmute-non-immediate-to-immediate.rs b/src/test/run-pass/transmute-non-immediate-to-immediate.rs index e070757eaf4..70a41f773a3 100644 --- a/src/test/run-pass/transmute-non-immediate-to-immediate.rs +++ b/src/test/run-pass/transmute-non-immediate-to-immediate.rs @@ -13,6 +13,6 @@ pub fn main() { unsafe { - ::std::mem::transmute::<[int,..1],int>([1]) + ::std::mem::transmute::<[int; 1],int>([1]) }; }