about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPiotr Jawniak <sawyer47@gmail.com>2014-08-23 12:31:48 +0200
committerPiotr Jawniak <sawyer47@gmail.com>2014-08-23 12:31:48 +0200
commited18baeb495a0f9663f81c3ad9687c775eb24270 (patch)
treed98107849ed8f1e2b76a4d13977f5c5fffeea21e /src
parentf92015f71b3a49abd490e704a011d14786f6bf87 (diff)
Add test for #10618 and #16382
Closes #10618
Closes #16382
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/cast-in-array-size.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/run-pass/cast-in-array-size.rs b/src/test/run-pass/cast-in-array-size.rs
new file mode 100644
index 00000000000..ce5fb672b21
--- /dev/null
+++ b/src/test/run-pass/cast-in-array-size.rs
@@ -0,0 +1,19 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+
+// issues #10618 and #16382
+static SIZE: int = 25;
+
+fn main() {
+    let _a: [bool, ..1 as uint];
+    let _b: [int, ..SIZE as uint] = [1, ..SIZE as uint];
+    let _c: [bool, ..'\n' as uint] = [true, ..'\n' as uint];
+}