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
Running the test suite in this repository through MIRI reports that <Vec<u8> as ByteVecExt>::try_extend_zeroed results in Undefined Behaviour.
I believe that this is because the end of as_mut_ptr_end is open and therefore is not pointing to anything borrowed. I'll open a pull request in a minute with a fix which both adds MIRI to CI and which passes all tests with MIRI.
The text was updated successfully, but these errors were encountered:
So this is because as_mut_ptr_end is actually a method on slices and the Vec will Deref to a slice first.
The PR fixes it via Vec's own as_mut_ptr impl and adding the length.
I doubt this specific code is UB in practice though; backports and/or an immediate release might not be necessary.
To be honest, I just want MIRI to pass on my project, and this was a snag. Like you say, I doubt the compiler is about to abuse this UB in any weird ways.
Running the test suite in this repository through MIRI reports that
<Vec<u8> as ByteVecExt>::try_extend_zeroed
results in Undefined Behaviour.I believe that this is because the end of
as_mut_ptr_end
is open and therefore is not pointing to anything borrowed. I'll open a pull request in a minute with a fix which both adds MIRI to CI and which passes all tests with MIRI.The text was updated successfully, but these errors were encountered: