summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_pass_by_ref_mut.stderr
blob: 5d1e9515de125b2c71b3b4186df15e7476091bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:12:11
   |
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`
   = help: to override `-D warnings` add `#[allow(clippy::needless_pass_by_ref_mut)]`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:37:12
   |
LL | fn foo6(s: &mut Vec<u32>) {
   |            ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:50:29
   |
LL |     fn mushroom(&self, vec: &mut Vec<i32>) -> usize {
   |                             ^^^^^^^^^^^^^ help: consider changing to: `&Vec<i32>`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:55:31
   |
LL |     fn badger(&mut self, vec: &mut Vec<i32>) -> usize {
   |                               ^^^^^^^^^^^^^ help: consider changing to: `&Vec<i32>`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:132:16
   |
LL | async fn a1(x: &mut i32) {
   |                ^^^^^^^^ help: consider changing to: `&i32`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:136:16
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:140:16
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:144:16
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:148:24
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:152:24
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:156:32
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:160:24
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:160:45
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:194:16
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:200:20
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:214:39
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:222:26
   |
LL | async fn inner_async3(x: &mut i32, y: &mut u32) {
   |                          ^^^^^^^^ help: consider changing to: `&i32`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:241:34
   |
LL | pub async fn call_in_closure1(n: &mut str) {
   |                                  ^^^^^^^^ help: consider changing to: `&str`
   |
   = warning: changing this function will impact semver compatibility

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:253:25
   |
LL | pub async fn closure(n: &mut usize) -> impl '_ + FnMut() {
   |                         ^^^^^^^^^^ help: consider changing to: `&usize`
   |
   = warning: changing this function will impact semver compatibility

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:260:20
   |
LL | pub fn closure2(n: &mut usize) -> impl '_ + FnMut() -> usize {
   |                    ^^^^^^^^^^ help: consider changing to: `&usize`
   |
   = warning: changing this function will impact semver compatibility

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:271:26
   |
LL | pub async fn closure4(n: &mut usize) {
   |                          ^^^^^^^^^^ help: consider changing to: `&usize`
   |
   = warning: changing this function will impact semver compatibility

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:311:18
   |
LL | fn _empty_tup(x: &mut (())) {}
   |                  ^^^^^^^^^ help: consider changing to: `&()`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:312:19
   |
LL | fn _single_tup(x: &mut ((i32,))) {}
   |                   ^^^^^^^^^^^^^ help: consider changing to: `&(i32,)`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:313:18
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:314:11
   |
LL | fn _fn(x: &mut (fn())) {}
   |           ^^^^^^^^^^^ help: consider changing to: `&fn()`

error: this argument is a mutable reference, but not used mutably
  --> $DIR/needless_pass_by_ref_mut.rs:316:23
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:317:20
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:318:18
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:319:25
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:320:20
   |
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
  --> $DIR/needless_pass_by_ref_mut.rs:321:20
   |
LL | fn _fn_with_ret(x: &mut unsafe extern "C" fn() -> (i32)) {}
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&unsafe extern "C" fn() -> (i32)`

error: aborting due to 31 previous errors