4 ms·
Why does the Rust compiler not optimize code assuming that two mutable references cannot alias? —https://stackoverflow.com/q/57259126/155423 https://stackoverfl
by shepmaster 6y ago
Why does the Rust compiler not optimize code assuming that two mutable references cannot alias? —https://stackoverflow.com/q/57259126/155423 https://stackoverflow.com/q/57259126/155423
- arcticbull 6y agoFollow along here for re-enabling: https://github.com/rust-lang/rust/issues/54878 https://github.com/rust-lang/rust/issues/54878 For what it's worth I did say "can be" not "is" because I wasn't sure of the current state of this feature. I was just passing on the theory. There are certainly other potential reasons, for instance constant expressions and generics. And, of course, the prohibited undefined behavior makes other optimizations possible, and potentially better.