4 ms·
Wow! I'm really impressed. One thing that might help is to require formal verification of code marked as "unsafe" to ensure memory safety (or simply to replace
by jasonhansel 7y ago
Wow! I'm really impressed. One thing that might help is to require formal verification of code marked as "unsafe" to ensure memory safety (or simply to replace unsafe code in the standard library with safe-but-slower code, e.g. by having a version of the standard library where the get_unchecked() method actually does perform bounds checks).
- Argorak 7y agoUnsafe 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.