Skip to content

rustup; test swap of element with itself #1682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0677d9729318441a1cdb0c74812ec4140fa4d35f
dc1eee2f256efbd1d3b50b6b090232f81cac6d72
6 changes: 6 additions & 0 deletions tests/run-pass/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ fn sort() {
v.sort();
}

fn swap() {
let mut v = vec![1, 2, 3, 4];
v.swap(2, 2);
}

fn main() {
assert_eq!(vec_reallocate().len(), 5);

Expand All @@ -161,4 +166,5 @@ fn main() {
push_str_ptr_stable();

sort();
swap();
}