Skip to content

Commit

Permalink
Add new regression test for needless_pass_by_ref_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 17, 2023
1 parent 1d01f1b commit 7e46217
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/ui/needless_pass_by_ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,16 @@ async fn inner_async3(x: &mut i32, y: &mut u32) {
.await;
}

// Should not warn.
async fn async_vec(b: &mut Vec<bool>) {
b.append(&mut vec![]);
}

// Should not warn.
async fn async_vec2(b: &mut Vec<bool>) {
b.push(true);
}

fn main() {
let mut u = 0;
let mut v = vec![0];
Expand Down

0 comments on commit 7e46217

Please sign in to comment.