Skip to content

Commit

Permalink
Auto merge of #1901 - RalfJung:rustup, r=RalfJung
Browse files Browse the repository at this point in the history
rustup; add swap_remove test

Adds a test for rust-lang/rust#90055
  • Loading branch information
bors committed Oct 21, 2021
2 parents 24a1d78 + a6b12c2 commit 084c660
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
81117ff930fbf3792b4f9504e3c6bccc87b10823
e015ef5b2633960e7653b744d7a1c3d1d336313a
9 changes: 9 additions & 0 deletions tests/run-pass/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -167,4 +175,5 @@ fn main() {

sort();
swap();
swap_remove();
}

0 comments on commit 084c660

Please sign in to comment.