It should be at least no harder than modern C, where any undefined behavior is a license for the optimizer to outright ignore the code you actually wrote. The main practical difficulty stems from the fact that Safe Rust rules are fully in effect even in an unsafe block, so you need to assess where references can be used instead of general pointers etc.
Re:What Is Rust's Hole Purpose?
by avgcorrection on Friday February 18, 2022 @04:30PM
(#30391374)
What was the Rustonomicon error?
Re:What Is Rust's Hole Purpose?
by steveklabnik on Friday February 18, 2022 @05:07PM
(#30391749)
I think they're talking about https://github.com/rust-unofficial/too-many-lists/issues/213
not rustonomicon, https://rust-unofficial.github.io/too-many-lists/fifth-layou... there are new sections that were recently added to this
I think miri is a part of the answer to this, but it is not perfect. At the end of the day, you need unsafe at some level to do anything useful, and we need more explicit rules about how to do it properly.