diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-12-20 15:20:51 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-12-20 15:23:29 +1300 |
| commit | 2e86929a4a5a36f3993e577b4582ba70d84bbb40 (patch) | |
| tree | 7b3e8049edae74dde7a870a7173afed6f9fc744e /src/test/compile-fail/repeat_count.rs | |
| parent | cbe9fb45bc705a89f23b434c686544d490923596 (diff) | |
| download | rust-2e86929a4a5a36f3993e577b4582ba70d84bbb40.tar.gz rust-2e86929a4a5a36f3993e577b4582ba70d84bbb40.zip | |
Allow use of `[_ ; n]` syntax for fixed length and repeating arrays.
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
Diffstat (limited to 'src/test/compile-fail/repeat_count.rs')
| -rw-r--r-- | src/test/compile-fail/repeat_count.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/compile-fail/repeat_count.rs b/src/test/compile-fail/repeat_count.rs index 38fbb426fb1..3b0ef0c293a 100644 --- a/src/test/compile-fail/repeat_count.rs +++ b/src/test/compile-fail/repeat_count.rs @@ -12,18 +12,18 @@ fn main() { let n = 1; - let a = [0, ..n]; //~ ERROR expected constant integer for repeat count, found variable - let b = [0, ..()]; + let a = [0; n]; //~ ERROR expected constant integer for repeat count, found variable + let b = [0; ()]; //~^ ERROR expected constant integer for repeat count, found non-constant expression //~^^ ERROR: expected `uint`, found `()` - let c = [0, ..true]; //~ ERROR expected positive integer for repeat count, found boolean + let c = [0; true]; //~ ERROR expected positive integer for repeat count, found boolean //~^ ERROR: expected `uint`, found `bool` - let d = [0, ..0.5]; //~ ERROR expected positive integer for repeat count, found float + let d = [0; 0.5]; //~ ERROR expected positive integer for repeat count, found float //~^ ERROR: expected `uint`, found `_` - let e = [0, .."foo"]; //~ ERROR expected positive integer for repeat count, found string + let e = [0; "foo"]; //~ ERROR expected positive integer for repeat count, found string //~^ ERROR: expected `uint`, found `&'static str` - let f = [0, ..-4]; + let f = [0; -4]; //~^ ERROR expected positive integer for repeat count, found negative integer - let f = [0u, ..-1]; + let f = [0u; -1]; //~^ ERROR expected positive integer for repeat count, found negative integer } |
