(I use C++ and I love it.)
(I use C++ and I love it.)
Undefined behavior? As in, you can confine it to `unsafe`?
What unsafe does, is it says to the compiler:
"Hey, I know you're just a dumb machine, and you couldn't prove this code obeys all the rules that keep Rust safe, but I am very smart and I promise it actually is safe". You're also encouraged to explain yourself (to other humans, not the compiler, this isn't Wuffs) so that anybody else maintaining the code can see why exactly you believed this was OK.
Over the years, some code which was once unsafe in Rust no longer needed an unsafe block, because Rust's compiler got smarter, "Oh, I see why this is OK".
But if your unsafe code has Undefined Behaviour that's actually a serious bug, it's not what unsafe is for at all.