Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ManuallyDrop with bumpalo's Box instead of mem::forget
Miri now reports UB with some uses of bumpalo's Box where it did not before: rust-lang/miri#2704 The previous behavior of Miri was a false negative. rustc applies noalias to newtype wrappers around &mut, so Miri has to retag &mut when passed by value to a function even if it is in a wrapper struct, such as bumpalo's Box. mem::forget is a common aliasing footgun, because for a unique-owning wrapper like Box, leaking an RAII handle re-asserts the uniqueness of the handle as it is sent to the void. Ouch. ManuallyDrop solves this problem.
- Loading branch information