You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
miri: Fix unsoundness in doctests for VolatileArrayRef
The tests in question took a mutable reference to the first element of a
vector, converted it to a `*mut u8` and constructed a `VolatileArrayRef`
from it. However, the pointer only has ownership of the first element of
the Vec, not the entire vector (since it originated from a reference to
the first element).
By using `Vec::as_mut_ptr()` instead, we get a pointer that takes
ownership of the entire backing memory, avoiding unsoundness.
Signed-off-by: Patrick Roy <[email protected]>
0 commit comments