News for hackers. Stuff that matters.
Re:The Compiler Is Your Best Friend, Stop Lying to It by the__alchemist on Wednesday December 31, 2025 @12:34PM (#46446271)
This is what rust's `unreachable()!` is for... and I feel hubris whenever I use it.
Re:The Compiler Is Your Best Friend, Stop Lying to It by tialaramex on Wednesday December 31, 2025 @02:32PM (#46447456)
You should prefer to write unreachable!("because ...") to explain to some future maintenance engineer (maybe yourself) why you believed this would never be reached. Since they know it was reached they can compare what you believed against their observed facts and likely make better decisions.

But at least telling people that the programmer believed this could never happen short-circuits their investigation considerably.