Skip to content

Commit 2640d5c

Browse files
committed
Auto merge of rust-lang#11622 - GuillaumeGomez:needless_pass_by_ref_mut-regression-test-11610, r=blyxyas
Add regression test for rust-lang#11610 about mutable usage of argument in async function for the `needless_pass_by_ref_mut` lint Fixes rust-lang/rust-clippy#11610. This was already fixed. I simply added a regression test. changelog: Add regression test for rust-lang#11610 about mutable usage of argument in async function for the `needless_pass_by_ref_mut` lint
2 parents 2cf708d + ddd1564 commit 2640d5c

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)