Re:Rust: Zero-Cost Abstraction in Action
by habitue on Saturday February 08, 2020 @12:59AM
(#22274215)
Actually, so there's a very good chance that this particular optimization is happening due to MIRI, which allows very sophisticated constant evaluation of MIR (a rust intermediate representation)
https://rust-lang.github.io/rustc-guide/miri.html
So while, yes, in general pretty much all rust optimizations are actually due to LLVM, this one in particular might not be