arrayvec
arrayvec copied to clipboard
Follow simplification of Vec::retain() (rust-lang/rust#91527)
Follows rust-lang/rust#91527. This is neutral in my go-to benchmarks, but it's probably good to keep the implementation in sync regardless.
Edit: Looks like miri does not like this, whereas it doesn't mind std. Reminds me of https://github.com/bluss/arrayvec/pull/174#pullrequestreview-594795729. Will debug later.
Fixed by dereferencing the pointer only for f(unsafe { &mut *cur }). To be honest, I don't understand how std gets away with not doing it like that.
@bluss Can we merge that? It would fix complains of miri about retain. https://github.com/bluss/arrayvec/issues/221
@niklasf
At this moment miri also don't like ArrayVec::drain and ArrayVec::retain.
P.S. How about adding my code from issue as test to ensure that it remains valid?
Looks like the stacked borrow violations have been addressed in a different way.