3 ms·
When a const fn is called from a const context, like assigning a value to a constant, the compiler interprets the function at compile time. If you're intereste
by KevinEldon 8y ago
When a const fn is called from a const context, like assigning a value to a constant, the compiler interprets the function at compile time.
If you're interested in more info the docs [1] and the New Rustacean 1.31 Part 2 podcast [2] are helpful.
[1] https://github.com/rust-lang-nursery/reference/blob/master/src/items/functions.md#const-functions https://github.com/rust-lang-nursery/reference/blob/master/s...
[2] https://newrustacean.com/show_notes/news/rust_1_31/part_2/index.html https://newrustacean.com/show_notes/news/rust_1_31/part_2/in...