Skip to content

Commit

Permalink
Auto merge of #11622 - GuillaumeGomez:needless_pass_by_ref_mut-regres…
Browse files Browse the repository at this point in the history
…sion-test-11610, r=blyxyas

Add regression test for #11610 about mutable usage of argument in async function for the `needless_pass_by_ref_mut` lint

Fixes #11610.

This was already fixed. I simply added a regression test.

changelog: Add regression test for #11610 about mutable usage of argument in async function for the `needless_pass_by_ref_mut` lint
  • Loading branch information
bors committed Oct 17, 2023
2 parents 2cf708d + ddd1564 commit 2640d5c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/ui/needless_pass_by_ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ pub async fn closure4(n: &mut usize) {
})();
}

// Should not warn.
async fn _f(v: &mut Vec<()>) {
let x = || v.pop();
_ = || || x;
}

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

0 comments on commit 2640d5c

Please sign in to comment.