Rusts memory safety is not a 100% protection here.
Sometimes writing to a memory you own has huge side effects. And that part is not handled by rust.