From a6b12c229b6f81716f30e8f6ba7b1a6e5485a1cd Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 21 Oct 2021 09:49:19 -0400 Subject: [PATCH] rustup; add swap_remove test --- rust-version | 2 +- tests/run-pass/vec.rs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rust-version b/rust-version index faba8395d1..7fb789d83d 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -81117ff930fbf3792b4f9504e3c6bccc87b10823 +e015ef5b2633960e7653b744d7a1c3d1d336313a diff --git a/tests/run-pass/vec.rs b/tests/run-pass/vec.rs index 5676f9b676..8ed81a5e34 100644 --- a/tests/run-pass/vec.rs +++ b/tests/run-pass/vec.rs @@ -140,6 +140,14 @@ fn swap() { v.swap(2, 2); } +fn swap_remove() { + let mut a = 0; + let mut b = 1; + let mut vec = vec![&mut a, &mut b]; + + vec.swap_remove(1); +} + fn main() { assert_eq!(vec_reallocate().len(), 5); @@ -167,4 +175,5 @@ fn main() { sort(); swap(); + swap_remove(); }