|
|
|
|
|
by littlestymaar
230 days ago
|
|
unsafe exist for that very reason. There's no Rabbi out there to mandate that your code is kosher, using unsafe is OK. Also, the situation where you really need it are rare in practice (in 9 years of full time Rust, I've yet to encounter one). |
|
I encourage you to write a doubly linked list in Rust if you want to understand what I mean about "un-kosher" code. This is a basic academic example, but Rust itself is the rabbi that makes your life suck if you stray off the narrow path.
I write a decent amount of system-level software and this kind of pattern is unavoidable if you actually need to interact with hardware or if you need very high performance. I have probably written the unsafe keyword several hundred times despite only having to use Rust professionally for a year.