3 ms·
You can't "turn off" memory safety in Rust, that's an absolutely misleading way to describe unsafe.
by couchand 4y ago
You can't "turn off" memory safety in Rust, that's an absolutely misleading way to describe unsafe.
- pencilguin 4y agoDo you prefer "opt out"?
- Filligree 4y agoI suppose the point GP is trying to make is that unsafe blocks don't really change the pre-existing safeties, it 'just' lets you also do things which are unsafe, but which have different syntax. Already-safe code remains safe if you wrap it with unsafe. The implications to a code reviewer don't change much from that, however.
- pencilguin 4y agoWhat is being turned off is not safety itself, but automatic enforcement of rules. If course no one wants to ship actually unsafe code, and it is very rare to do it in Rust or modern C++ programs. But it is depressingly common in C programs and mostly-old programs like Chromium, and in the C libraries that programs of all kinds still depend on.