News for hackers. Stuff that matters.
Re:Smart pointers for the kernel by uecker on Friday October 18, 2024 @12:04PM (#41880678)
In other words, somebody made an error somewhere.
Re:Smart pointers for the kernel by dwattttt on Friday October 18, 2024 @03:52PM (#41882866)
You're thinking of C; Rust forced that somebody to write unsafe near it to create the bug.
Re:Smart pointers for the kernel by uecker on Saturday October 19, 2024 @01:07AM (#41885767)
The bug that can lead to a violation of assumptions required for safety of the unsafe block can be elsewhere. One can hope that it is near the bloc, but there is nothing in Rust enforcing this.
Re:Smart pointers for the kernel by Dylan16807 on Saturday October 19, 2024 @03:58PM (#41890304)
When you write "unsafe", you are promising to the compiler that the unsafe code enforces the assumptions it is making.

Unsafe code needs to keep its assumption-laden variables private, and it needs to verify the parameters that safe code sends it. If it doesn't do those things, it's breaking that promise.