1 // Copyright 2012 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.
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.
11 const x : [int; 4] = [1,2,3,4];
12 static p : int = x[2];
13 const y : &'static [int] = &[1,2,3,4];
14 static q : int = y[2];
16 struct S {a: int, b: int}
18 const s : S = S {a: 10, b: 20};
21 struct K {a: int, b: int, c: D}
22 struct D { d: int, e: int }
24 const k : K = K {a: 10, b: 20, c: D {d: 30, e: 40}};
25 static m : int = k.c.e;