How does Rust abort in no_std ?
Hi,
in no_std Rust, how does Rust enforce it's safety exactly ?
Because in traditional Rust, after a runtime safety violation is detected say like an out of bounds, panic! is called.
But in no std there's no panic!.
so how does the process actually guarantee it would exit and therefore enforce the safety rules set by the language? is no_std actually less secure than std ?
I thought from my understanding, that Rust calls a function which in turns runs an invalid CPU instruction which is supposed to crash the program (almost) always. Which is not a guaranteed neither, and the link even agrees:
"The precise behavior is not guaranteed and not stable."
So sometime, when that behavior is not guaranteed, some critical Rust features would not take effect!?
https://doc.rust-lang.org/core/intrinsics/fn.abort.html
But, again, from that link, I see it's a nightly-only feature, so how does current Rust compiler actually enforce the safety?
Thanks.