Auto merge of #11622 - GuillaumeGomez:needless_pass_by_ref_mut-regression-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 https://github.com/rust-lang/rust-clippy/issues/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
This commit is contained in:
bors 2023-10-17 12:20:03 +00:00
commit 2640d5cc85

View file

@ -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];