Skip to content

Commit

Permalink
Add regression test for rust-lang#11610 about mutable usage of argume…
Browse files Browse the repository at this point in the history
…nt in async function for the `needless_pass_by_ref_mut` lint
  • Loading branch information
GuillaumeGomez committed Oct 6, 2023
1 parent 9554e47 commit ddd1564
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 ddd1564

Please sign in to comment.