2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-05-28 14:20:32 -05:00
|
|
|
|
2015-05-29 08:42:32 -05:00
|
|
|
struct Foo { value: u32 }
|
2015-05-28 14:20:32 -05:00
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
const fn new() -> Foo {
|
|
|
|
Foo { value: 22 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const FOO: Foo = Foo::new();
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
assert_eq!(FOO.value, 22);
|
2015-11-27 09:43:24 -06:00
|
|
|
let _: [&'static str; Foo::new().value as usize] = ["hey"; 22];
|
2015-05-28 14:20:32 -05:00
|
|
|
}
|