| ▲ | krona 3 hours ago | ||||||||||||||||
I can't tell if you're trolling but `unsafe { crash() }` is safe from the compiler's perspective. Otherwise you wouldn't be able to achieve anything in 'safe' rust, even print to stdout. | |||||||||||||||||
| ▲ | flomo 3 hours ago | parent [-] | ||||||||||||||||
I think its a good question, just because the whole UB thing is such an ideological shibboleth. Maybe its better to think about this in the reverse, where C and C++ has 'defined behavior', but unsafe rust intentionally does not, its just whatever the complier and platform lets you get away with. Ultimately its still just a computer which stores values in memory and jumps to subroutines. | |||||||||||||||||
| |||||||||||||||||