2023-07-17 08:19:29 +00:00
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:11:11
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
|
LL | fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) {
|
|
|
|
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-pass-by-ref-mut` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::needless_pass_by_ref_mut)]`
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:36:12
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
|
LL | fn foo6(s: &mut Vec<u32>) {
|
|
|
|
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:46:12
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
2024-05-02 15:26:44 +00:00
|
|
|
LL | fn bar(&mut self) {}
|
|
|
|
| ^^^^^^^^^ help: consider changing to: `&self`
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:49:29
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
2024-05-02 15:26:44 +00:00
|
|
|
LL | fn mushroom(&self, vec: &mut Vec<i32>) -> usize {
|
|
|
|
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<i32>`
|
2023-07-17 08:19:29 +00:00
|
|
|
|
2023-07-31 21:53:53 +00:00
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:126:16
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a1(x: &mut i32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:130:16
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a2(x: &mut i32, y: String) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:134:16
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a3(x: &mut i32, y: String, z: String) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:138:16
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a4(x: &mut i32, y: i32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:142:24
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a5(x: i32, y: &mut i32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:146:24
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a6(x: i32, y: &mut i32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:150:32
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a7(x: i32, y: i32, z: &mut i32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:154:24
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a8(x: i32, a: &mut i32, y: i32, z: &mut i32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:154:45
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | async fn a8(x: i32, a: &mut i32, y: i32, z: &mut i32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:188:16
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | fn cfg_warn(s: &mut u32) {}
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&u32`
|
|
|
|
|
|
|
|
|
= note: this is cfg-gated and may require further changes
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:194:20
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | fn cfg_warn(s: &mut u32) {}
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&u32`
|
|
|
|
|
|
|
|
|
= note: this is cfg-gated and may require further changes
|
|
|
|
|
2023-08-17 15:55:23 +00:00
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:208:39
|
2023-08-17 15:55:23 +00:00
|
|
|
|
|
|
|
|
LL | async fn inner_async2(x: &mut i32, y: &mut u32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&u32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:216:26
|
2023-08-17 15:55:23 +00:00
|
|
|
|
|
|
|
|
LL | async fn inner_async3(x: &mut i32, y: &mut u32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&i32`
|
|
|
|
|
2023-09-25 09:28:58 +00:00
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:235:30
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
2023-10-09 09:48:13 +00:00
|
|
|
LL | async fn call_in_closure1(n: &mut str) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&str`
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:254:16
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
2023-10-09 09:48:13 +00:00
|
|
|
LL | fn closure2(n: &mut usize) -> impl '_ + FnMut() -> usize {
|
|
|
|
| ^^^^^^^^^^ help: consider changing to: `&usize`
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:265:22
|
2023-09-25 09:28:58 +00:00
|
|
|
|
|
2023-10-09 09:48:13 +00:00
|
|
|
LL | async fn closure4(n: &mut usize) {
|
|
|
|
| ^^^^^^^^^^ help: consider changing to: `&usize`
|
2023-09-25 09:28:58 +00:00
|
|
|
|
2023-12-16 13:12:50 +00:00
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:319:12
|
2024-05-02 15:26:44 +00:00
|
|
|
|
|
|
|
|
LL | fn bar(&mut self) {}
|
|
|
|
| ^^^^^^^^^ help: consider changing to: `&self`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:321:18
|
2024-05-02 15:26:44 +00:00
|
|
|
|
|
|
|
|
LL | async fn foo(&mut self, u: &mut i32, v: &mut u32) {
|
|
|
|
| ^^^^^^^^^ help: consider changing to: `&self`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:321:45
|
2024-05-02 15:26:44 +00:00
|
|
|
|
|
|
|
|
LL | async fn foo(&mut self, u: &mut i32, v: &mut u32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&u32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:329:46
|
2024-05-02 15:26:44 +00:00
|
|
|
|
|
|
|
|
LL | async fn foo2(&mut self, u: &mut i32, v: &mut u32) {
|
|
|
|
| ^^^^^^^^ help: consider changing to: `&u32`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:345:18
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _empty_tup(x: &mut (())) {}
|
|
|
|
| ^^^^^^^^^ help: consider changing to: `&()`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:346:19
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _single_tup(x: &mut ((i32,))) {}
|
|
|
|
| ^^^^^^^^^^^^^ help: consider changing to: `&(i32,)`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:347:18
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _multi_tup(x: &mut ((i32, u32))) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: consider changing to: `&(i32, u32)`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:348:11
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _fn(x: &mut (fn())) {}
|
|
|
|
| ^^^^^^^^^^^ help: consider changing to: `&fn()`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:350:23
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _extern_rust_fn(x: &mut extern "Rust" fn()) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&extern "Rust" fn()`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:351:20
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _extern_c_fn(x: &mut extern "C" fn()) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&extern "C" fn()`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:352:18
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _unsafe_fn(x: &mut unsafe fn()) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe fn()`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:353:25
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _unsafe_extern_fn(x: &mut unsafe extern "C" fn()) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe extern "C" fn()`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:354:20
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _fn_with_arg(x: &mut unsafe extern "C" fn(i32)) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe extern "C" fn(i32)`
|
|
|
|
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
2023-10-09 09:48:13 +00:00
|
|
|
--> tests/ui/needless_pass_by_ref_mut.rs:355:20
|
2023-12-16 13:12:50 +00:00
|
|
|
|
|
|
|
|
LL | fn _fn_with_ret(x: &mut unsafe extern "C" fn() -> (i32)) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe extern "C" fn() -> (i32)`
|
|
|
|
|
2024-05-02 15:26:44 +00:00
|
|
|
error: aborting due to 34 previous errors
|
2023-07-17 08:19:29 +00:00
|
|
|
|