Skip to content

Commit ddd1564

Browse files
Add regression test for #11610 about mutable usage of argument in async function for the needless_pass_by_ref_mut lint
1 parent 9554e47 commit ddd1564

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/ui/needless_pass_by_ref_mut.rs

+6
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ pub async fn closure4(n: &mut usize) {
270270
})();
271271
}
272272

273+
// Should not warn.
274+
async fn _f(v: &mut Vec<()>) {
275+
let x = || v.pop();
276+
_ = || || x;
277+
}
278+
273279
fn main() {
274280
let mut u = 0;
275281
let mut v = vec![0];

0 commit comments

Comments
 (0)