Closed
Description
What has to happen for us to enable -Zmiri-retag-fields
by default? LLVM already does optimizations that can only be explained on the Rust level if we do field retagging. This is the last case I am aware of of Rust code that has LLVM UB but is not considered UB by Miri. (There are other differences between Miri and the Reference, but none of those are LLVM UB -- all that extra UB is wiggle room for future optimizations, but not exploited yet.)
@saethlin has been doing some experiments here I think, but I am no aware of the current status. As a start, we should probably get miri-test-libstd to pass with field retagging.
Related issues:
- VecDeque's Drain::drop writes to memory that a shared reference points to rust#60076
- Scoped threads violate 'dereferenceable for function call' requirement of references rust#101983
- Release of hashbrown that includes Fix issue with field retagging in scopeguard hashbrown#359
- Release of scopeguard that includes Use ManuallyDrop instead of mem::forget in into_inner bluss/scopeguard#25