mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
Add test for closure in non-async function for needless_pass_by_ref_mut
lint
This commit is contained in:
parent
ec2b8ab83a
commit
3b4b07c5f8
1 changed files with 9 additions and 0 deletions
|
@ -288,6 +288,15 @@ fn get_mut_unchecked2<T>(ptr: &mut NonNull<Data<T>>) -> &mut T {
|
|||
unsafe { &mut (*ptr.as_ptr()).value }
|
||||
}
|
||||
|
||||
fn set_true(b: &mut bool) {
|
||||
*b = true;
|
||||
}
|
||||
|
||||
// Should not warn.
|
||||
fn true_setter(b: &mut bool) -> impl FnOnce() + '_ {
|
||||
move || set_true(b)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut u = 0;
|
||||
let mut v = vec![0];
|
||||
|
|
Loading…
Add table
Reference in a new issue