mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 14:52:56 +03:00
3680ecd8a6
Fix MIRI UB in `Vec::swap_remove` Fixes #90055 I find it weird that `Vec::swap_remove` read the last element to the stack just to immediately put it back in the `Vec` in place of the one at index `index`. It seems much more natural to me to just read the element at position `index` and then move the last element in its place. I guess this might also slightly improve codegen.