Get the latest tech news
Rust: Box Is a Unique Type
About better aliasing semantics for `Box`
This kind of partial deref move is just one of the spectacular magic tricks box has up its sleeve, and they exist for good reason: They are very useful. I cannot recommend Miri highly enough for all unsafe code you’re writing (sadly support for some IO functions and FFI is still lacking, and it’s still very slow). It has to, since otherwise the optimizer wouldn’t be allowed to change observable behaviour (since the assert doesn’t fail in debug mode).$ cargo miri run…
Or read this on Hacker News