Skip to content

Commit 6fdda8a

Browse files
committed
Auto merge of #1682 - RalfJung:rustup, r=RalfJung
rustup; test swap of element with itself Cc rust-lang/rust#80682
2 parents 903bfd8 + 3990deb commit 6fdda8a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0677d9729318441a1cdb0c74812ec4140fa4d35f
1+
dc1eee2f256efbd1d3b50b6b090232f81cac6d72

tests/run-pass/vec.rs

+6
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ fn sort() {
135135
v.sort();
136136
}
137137

138+
fn swap() {
139+
let mut v = vec![1, 2, 3, 4];
140+
v.swap(2, 2);
141+
}
142+
138143
fn main() {
139144
assert_eq!(vec_reallocate().len(), 5);
140145

@@ -161,4 +166,5 @@ fn main() {
161166
push_str_ptr_stable();
162167

163168
sort();
169+
swap();
164170
}

0 commit comments

Comments
 (0)