4 ms·
> “Safe” code is guaranteed to be 100% safe. Not statistically safe. Not safe when the compiler feels like it. As long as your code compiles, it will be safe i
by michaelmior 10y ago
> “Safe” code is guaranteed to be 100% safe. Not statistically safe. Not safe when the compiler feels like it. As long as your code compiles, it will be safe in terms of memory safety and data-race freedom.
As far as I am aware, the Rust compiler has not been proved correct. So whether or not your code is correct still depends on the correctness of the compiler. Of course this is probably correct, but still not 100% guaranteed.
Edit: Relevant discussion - https://github.com/rust-lang/rust/issues/9883 https://github.com/rust-lang/rust/issues/9883
- millstone 10y agoI can make your code as safe as you like, if you only let me define what "safe" means!