can you show me how rust does this? I'm genuinely curious.
I've made a toy example to show how c++ checks for undefined behavior at compile time, I am unaware of rust being able to do the same without runtime costs (however small they may be, this is a toy example after all)
https://godbolt.org/z/cT9bqz8z7
kaashif|1 year ago
"Make everything constexpr" isn't a real solution to UB, in the same way that "make all functions pure" isn't a solution for managing side effects.
Not adding UB to your APIs, on the other hand, is a real solution.
umanwizard|1 year ago
unknown|1 year ago
[deleted]
elteto|1 year ago
macgyverismo|1 year ago