You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> rustc test.rs
test.rs:6:19: 6:24 error: function calls in statics are limited to constant functions, struct and enum constructors [E0015]
test.rs:6 static foo: Foo = bar();
^~~~~
test.rs:6:19: 6:24 help: run `rustc --explain E0015` to see a detailed explanation
> rustc --explain E0015
The only functions that can be called in static or constant expressions are
`const` functions. Rust currently does not support more general compile-time
function execution.
See [RFC 911] for more details on the design of `const fn`s.
[RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md