]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/check-static-slice.rs
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.
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 // Check that the various ways of getting to a reference to a vec (both sized
12 // and unsized) work properly.
14 // pretty-expanded FIXME #23616
16 const aa
: [isize; 3] = [1, 2, 3];
17 const ab
: &'
static [isize; 3] = &aa
;
18 const ac
: &'
static [isize] = ab
;
19 const ad
: &'
static [isize] = &aa
;
20 const ae
: &'
static [isize; 3] = &[1, 2, 3];
21 const af
: &'
static [isize] = &[1, 2, 3];
23 static ca
: isize = aa
[0];
24 static cb
: isize = ab
[1];
25 static cc
: isize = ac
[2];
26 static cd
: isize = ad
[0];
27 static ce
: isize = ae
[1];
28 static cf
: isize = af
[2];
31 let b
: &[isize] = &[1, 2, 3];