Why people misunderstand the unsafe keyword so much

323 points Remote-End6122 77 comments

From time to time I talk or see people talking about unsafe rust, saying that it disables the compilers checks, the borrow check and that it leads to memory leaks (which I guess it could, but not always true)...

Rust unsafe only allows you to do 5 things that you couldn't in safe rust, that's all. Even the rust book says it

https://preview.redd.it/6jorviyjuyge1.png?width=776&format=png&auto=webp&s=39d81e3716ec723d4e48516605c9cea0da094bbd