mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-19 14:17:51 +02:00
Undefined behavior does not just mean that the behavior can be different on different platforms. It is much worse than that: the runtime behavior can be completely nonsensical since the whole program has undefined behavior. The compiler will optimizer as if there is no undefined behavior and will can lead to strange situations as the compiler concludes that things like `a > a + 1000` can never be reached if `a` is a signed 8-bit value (since reaching it would trigger undefined behavior).