4 ms·
Very curious to know an example of what's ok in Rust but not in C
by bloppe 2y ago
Very curious to know an example of what's ok in Rust but not in C
- whytevuhuni 2y agoOf the things you can do: Integer overflow (wrapping in Rust, undefined behavior in C), indexing out of bounds (panic in Rust, UB in C), unwinding stack frames (runs destructors in Rust, UB in C) Of the things you can try to do, but will be prevented: use-after-free, double-free, using uninitialized variables, null references, modifying constants, data races
- steveklabnik 2y agoThe most straightforward one is that Rust doesn't have strict aliasing.