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

8 lines
137 B
Rust
Raw Normal View History

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