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:
Guillaume Gomez 2023-10-06 11:18:34 +02:00
parent 9554e477c2
commit ddd1564e5d

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