Re:Rust 1.47
by scudd on Thursday October 08, 2020 @11:05AM
(#24719740)
Can increase in use of `const fn`'s create a noticeable decrease in compile times? As someone whose never worked on compilers, I'm not really sure what the magnitude of that processing time is in relation to everything else.
[ Parent
| on HN ]
The compiler would already evaluate most of this stuff at compile time, you just weren't allowed to rely on it until now.
e.g. char::is_ascii_alphabetic() was made const in 1.47, but 1.46 would already run it at compile time: https://godbolt.org/z/hWf65f
The difference is in 1.47 you can use the result to assign something that must be known at compile time.