Was reading this in The Rustonomicon and couldn’t help laughing:
Safe Rust is the true Rust programming language. If all you do is write Safe Rust, you will never have to worry about type-safety or memory-safety. You will never endure a null or dangling pointer, or any of that Undefined Behavior nonsense.
That’s totally awesome.
And yet this is “safe” Rust that is totally wrong and will produce a memory corrupted string:
let a:LPCSTR = CString::new("Some string for Windows API").unwrap().as_ptr();
This took me two days to debug, no warning, no error.