logoalt Hacker News

jcranmeryesterday at 7:20 PM1 replyview on HN

Rust has lots of undefined behavior, in general a broadly similar set to that which exists in C. What Rust does that is different is that to trigger undefined behavior, you need to execute unsafe code. (This isn't the same as saying that you have to be in unsafe code--you can violate a precondition in unsafe code and have the UB itself trigger in safe code).


Replies

stavrosyesterday at 7:30 PM

That's a good explanation, thank you.