3 ms·
There is a reason Rust has debug and release builds as well to what other commenters have said. In the debug builds there are safeguards against almost everythi
by zanny 10y ago
There is a reason Rust has debug and release builds as well to what other commenters have said. In the debug builds there are safeguards against almost everything at performance cost, the way you are supposed to use it is to test your debug builds thoroughly and then you can trust the release builds to be safe because your code doesn't change, the compiler just doesn't insert as many guards.
- steveklabnik 10y agoIn general, this is less true than in other languages though; for example, assert! is still in release builds in Rust. If you want that semantic, you need debug_assert!