|
| 1 | +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT |
| 2 | +// file at the top-level directory of this distribution and at |
| 3 | +// http://rust-lang.org/COPYRIGHT. |
| 4 | +// |
| 5 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | +// option. This file may not be copied, modified, or distributed |
| 9 | +// except according to those terms. |
| 10 | + |
| 11 | +#![crate_type="lib"] |
| 12 | + |
| 13 | +// #4264 fixed-length vector types |
| 14 | + |
| 15 | +pub fn foo(_: [int, ..3]) {} |
| 16 | + |
| 17 | +pub fn bar() { |
| 18 | + static FOO: uint = 5u - 4u; |
| 19 | + let _: [(), ..FOO] = [()]; |
| 20 | + |
| 21 | + let _ : [(), ..1u] = [()]; |
| 22 | + |
| 23 | + let _ = &([1i,2,3]) as *const _ as *const [int, ..3u]; |
| 24 | + |
| 25 | + format!("test"); |
| 26 | +} |
| 27 | + |
| 28 | +pub type Foo = [int, ..3u]; |
| 29 | + |
| 30 | +pub struct Bar { |
| 31 | + pub x: [int, ..3u] |
| 32 | +} |
| 33 | + |
| 34 | +pub struct TupleBar([int, ..4u]); |
| 35 | + |
| 36 | +pub enum Baz { |
| 37 | + BazVariant([int, ..5u]) |
| 38 | +} |
| 39 | + |
| 40 | +pub fn id<T>(x: T) -> T { x } |
| 41 | + |
| 42 | +pub fn use_id() { |
| 43 | + let _ = id::<[int, ..3u]>([1,2,3]); |
| 44 | +} |
0 commit comments