HN2new | past | comments | ask | show | jobs | submitlogin

Does Rust apply aliasing optimisations now? Last I heard of that, they kept having to turn it back off because of LLVM bugs concerning aliasing.


Rust (and, for that matter, C++ compilers) have always applied optimizations that rely on alias analysis. What I assume this thread is referring to is the noalias LLVM attribute on &mut function parameters. Rust now applies this.


In any case, it's still UB under the language guidelines, it's just not exploited yet.


I believe since the last time they were turned on they have stayed on, yes.


Rust does not use type-based alias analysis (the "strict aliasing" problem), however.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: