1 A function call isn't allowed in the const's initialization expression
2 because the expression's value must be known at compile-time.
4 Erroneous code example:
7 #![feature(box_syntax)]
12 static STATIC11: Box<MyOwned> = box MyOwned; // error!
16 Remember: you can't use a function call inside a const's initialization
17 expression! However, you can totally use it anywhere else:
25 fn func(&self) -> i32 {
31 const FOO: Test = Test::V1;
33 FOO.func(); // here is good
34 let x = FOO.func(); // or even here!