3 ms·
Unsafe code is a really hot subject in the Rust project already and there's tons of research work around that done by Ralf: https://www.ralfj.de/blog/categories
by Argorak 7y ago
Unsafe code is a really hot subject in the Rust project already and there's tons of research work around that done by Ralf: https://www.ralfj.de/blog/categories/research.html https://www.ralfj.de/blog/categories/research.html.
He's also building Rust tooling for finding bugs in this space, see for example miri.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=d15868687f79072688a0d0dd1e053721 https://play.rust-lang.org/?version=stable&mode=debug&editio...
(click "Tools" -> "Miri")
This will figure out that you do produce an illegal borrow in that unsafe code.