How does the Rust compiler analyze, diagnose and optimize if
-expressions that are compile-time constants. For instance such as in
?
In D, static if
should have been used instead. And the D compilers warn when the if
-expression is a compile-time constant (D enum
).