News for hackers. Stuff that matters.
Re:Turning off Rust's borrow checker, completely by piaste on Tuesday January 23, 2024 @06:07AM (#39101882)
The parent's point is that there is no separation between "before" or "after", it all ends up in the same artifact. And when you write invalid code, you have no guarantees about the compiled artifact anymore.

There is an example of C code (fairly sure I saw it on HN) where violating a UB rule caused an entirely dead piece of code to suddenly be executed, which even made sense after explanation.

In the linked article, Rust-minus-borrow-checker somehow caused an invalid number to appear inside a compile-time static array.

Sure, poke around the results of UB all you want. Curiosity is great. But at some point you'll have to compile your hypothesis as part of valid code, to be able to trust the results.

Re:Turning off Rust's borrow checker, completely by dtn on Tuesday January 23, 2024 @09:22AM (#39103618)
Re:Turning off Rust's borrow checker, completely by piaste on Tuesday January 23, 2024 @10:14AM (#39104416)
Thanks for the link! I think I had in mind another one, where the UB fuckery happened at a lower level (I think you ended up with a semicolon/brace effectively "disappearing"?). But that's a good example too.