News for hackers. Stuff that matters.
Re:Zlib-rs is faster than C by rybosome on Sunday March 16, 2025 @06:44PM (#43383265)
I believe the post you are replying to was referring to the fact that you could take actions in that unsafe block that would compromise the guarantees of rust; eg you could do something silly, leave the unsafe block, then hit an “impossible” condition later in the program.

A simple example might be modifying a const value deep down in some class, where it only becomes apparent later in the program’s execution. Hence their analogy of the wet dog in a clean room - whatever beliefs you have about the structure of memory in your entire program, and guaranteed by the compiler, could have been undone by a rogue unsafe.

Re:Zlib-rs is faster than C by umanwizard on Tuesday March 18, 2025 @01:37AM (#43396097)
Rust doesn’t have classes, nor can const values be modified, even in unsafe code. (did you mean “immutable”?)