rust/tests/run-pass/issue-5917.rs

8 lines
137 B
Rust
Raw Normal View History

2017-02-08 08:32:49 -06:00
struct T (&'static [isize]);
2017-02-08 08:38:48 -06:00
static STATIC : T = T (&[5, 4, 3]);
2017-02-08 08:32:49 -06:00
pub fn main () {
2017-02-08 08:38:48 -06:00
let T(ref v) = STATIC;
2017-02-08 08:32:49 -06:00
assert_eq!(v[0], 5);
}