Re:Turning off Rust's borrow checker, completely
by dtn on Tuesday January 23, 2024 @09:22AM
(#39103618)
I think you're referring to this one: https://blog.tchatzigiannakis.com/undefined-behavior-can-lit...
Bonus read: https://devblogs.microsoft.com/oldnewthing/20140627-00/?p=63...
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.
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.