2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2015-05-28 15:20:32 -04:00
|
|
|
|
2015-05-29 09:42:32 -04:00
|
|
|
struct Foo { value: u32 }
|
2015-05-28 15:20:32 -04: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 16:43:24 +01:00
|
|
|
let _: [&'static str; Foo::new().value as usize] = ["hey"; 22];
|
2015-05-28 15:20:32 -04:00
|
|
|
}
|