1 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
2 --> $DIR/matches.rs:31:5
4 31 | / match ExprNode::Butterflies {
5 32 | | ExprNode::ExprAddrOf => Some(&NODE),
6 33 | | _ => { let x = 5; None },
8 | |_____^ help: try this: `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
10 = note: `-D clippy::single-match-else` implied by `-D warnings`
12 error: you don't need to add `&` to all patterns
13 --> $DIR/matches.rs:40:9
16 41 | | &Some(v) => println!("{:?}", v),
17 42 | | &None => println!("none"),
21 = note: `-D clippy::match-ref-pats` implied by `-D warnings`
22 help: instead of prefixing all patterns with `&`, you can dereference the expression
25 41 | Some(v) => println!("{:?}", v),
26 42 | None => println!("none"),
29 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
30 --> $DIR/matches.rs:50:5
33 51 | | &(v, 1) => println!("{}", v),
34 52 | | _ => println!("none"),
36 | |_____^ help: try this: `if let &(v, 1) = tup { println!("{}", v) } else { println!("none") }`
38 error: you don't need to add `&` to all patterns
39 --> $DIR/matches.rs:50:5
42 51 | | &(v, 1) => println!("{}", v),
43 52 | | _ => println!("none"),
46 help: instead of prefixing all patterns with `&`, you can dereference the expression
49 51 | (v, 1) => println!("{}", v),
52 error: you don't need to add `&` to both the expression and the patterns
53 --> $DIR/matches.rs:56:5
56 57 | | &Some(v) => println!("{:?}", v),
57 58 | | &None => println!("none"),
63 57 | Some(v) => println!("{:?}", v),
64 58 | None => println!("none"),
67 error: you don't need to add `&` to all patterns
68 --> $DIR/matches.rs:67:5
70 67 | / if let &None = a {
71 68 | | println!("none");
74 help: instead of prefixing all patterns with `&`, you can dereference the expression
76 67 | if let None = *a {
79 error: you don't need to add `&` to both the expression and the patterns
80 --> $DIR/matches.rs:72:5
82 72 | / if let &None = &b {
83 73 | | println!("none");
88 72 | if let None = b {
91 error: some ranges overlap
92 --> $DIR/matches.rs:81:9
94 81 | 0 ... 10 => println!("0 ... 10"),
97 = note: `-D clippy::match-overlapping-arm` implied by `-D warnings`
98 note: overlaps with this
99 --> $DIR/matches.rs:82:9
101 82 | 0 ... 11 => println!("0 ... 11"),
104 error: some ranges overlap
105 --> $DIR/matches.rs:87:9
107 87 | 0 ... 5 => println!("0 ... 5"),
110 note: overlaps with this
111 --> $DIR/matches.rs:89:9
113 89 | FOO ... 11 => println!("0 ... 11"),
116 error: some ranges overlap
117 --> $DIR/matches.rs:95:9
119 95 | 0 ... 5 => println!("0 ... 5"),
122 note: overlaps with this
123 --> $DIR/matches.rs:94:9
125 94 | 2 => println!("2"),
128 error: some ranges overlap
129 --> $DIR/matches.rs:101:9
131 101 | 0 ... 2 => println!("0 ... 2"),
134 note: overlaps with this
135 --> $DIR/matches.rs:100:9
137 100 | 2 => println!("2"),
140 error: some ranges overlap
141 --> $DIR/matches.rs:124:9
143 124 | 0 .. 11 => println!("0 .. 11"),
146 note: overlaps with this
147 --> $DIR/matches.rs:125:9
149 125 | 0 ... 11 => println!("0 ... 11"),
152 error: Err(_) will match all errors, maybe not a good idea
153 --> $DIR/matches.rs:142:9
155 142 | Err(_) => panic!("err")
158 = note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
159 = note: to remove this warning, match each error separately or use unreachable macro
161 error: this `match` has identical arm bodies
162 --> $DIR/matches.rs:141:18
164 141 | Ok(_) => println!("ok"),
167 = note: `-D clippy::match-same-arms` implied by `-D warnings`
169 --> $DIR/matches.rs:140:18
171 140 | Ok(3) => println!("ok"),
173 note: consider refactoring into `Ok(3) | Ok(_)`
174 --> $DIR/matches.rs:140:18
176 140 | Ok(3) => println!("ok"),
178 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
180 error: Err(_) will match all errors, maybe not a good idea
181 --> $DIR/matches.rs:148:9
183 148 | Err(_) => {panic!()}
186 = note: to remove this warning, match each error separately or use unreachable macro
188 error: this `match` has identical arm bodies
189 --> $DIR/matches.rs:147:18
191 147 | Ok(_) => println!("ok"),
195 --> $DIR/matches.rs:146:18
197 146 | Ok(3) => println!("ok"),
199 note: consider refactoring into `Ok(3) | Ok(_)`
200 --> $DIR/matches.rs:146:18
202 146 | Ok(3) => println!("ok"),
204 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
206 error: Err(_) will match all errors, maybe not a good idea
207 --> $DIR/matches.rs:154:9
209 154 | Err(_) => {panic!();}
212 = note: to remove this warning, match each error separately or use unreachable macro
214 error: this `match` has identical arm bodies
215 --> $DIR/matches.rs:153:18
217 153 | Ok(_) => println!("ok"),
221 --> $DIR/matches.rs:152:18
223 152 | Ok(3) => println!("ok"),
225 note: consider refactoring into `Ok(3) | Ok(_)`
226 --> $DIR/matches.rs:152:18
228 152 | Ok(3) => println!("ok"),
230 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
232 error: this `match` has identical arm bodies
233 --> $DIR/matches.rs:160:18
235 160 | Ok(_) => println!("ok"),
239 --> $DIR/matches.rs:159:18
241 159 | Ok(3) => println!("ok"),
243 note: consider refactoring into `Ok(3) | Ok(_)`
244 --> $DIR/matches.rs:159:18
246 159 | Ok(3) => println!("ok"),
248 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
250 error: this `match` has identical arm bodies
251 --> $DIR/matches.rs:167:18
253 167 | Ok(_) => println!("ok"),
257 --> $DIR/matches.rs:166:18
259 166 | Ok(3) => println!("ok"),
261 note: consider refactoring into `Ok(3) | Ok(_)`
262 --> $DIR/matches.rs:166:18
264 166 | Ok(3) => println!("ok"),
266 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
268 error: this `match` has identical arm bodies
269 --> $DIR/matches.rs:173:18
271 173 | Ok(_) => println!("ok"),
275 --> $DIR/matches.rs:172:18
277 172 | Ok(3) => println!("ok"),
279 note: consider refactoring into `Ok(3) | Ok(_)`
280 --> $DIR/matches.rs:172:18
282 172 | Ok(3) => println!("ok"),
284 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
286 error: this `match` has identical arm bodies
287 --> $DIR/matches.rs:179:18
289 179 | Ok(_) => println!("ok"),
293 --> $DIR/matches.rs:178:18
295 178 | Ok(3) => println!("ok"),
297 note: consider refactoring into `Ok(3) | Ok(_)`
298 --> $DIR/matches.rs:178:18
300 178 | Ok(3) => println!("ok"),
302 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
304 error: this `match` has identical arm bodies
305 --> $DIR/matches.rs:200:29
307 200 | (Ok(_), Some(x)) => println!("ok {}", x),
308 | ^^^^^^^^^^^^^^^^^^^^
311 --> $DIR/matches.rs:199:29
313 199 | (Ok(x), Some(_)) => println!("ok {}", x),
314 | ^^^^^^^^^^^^^^^^^^^^
315 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
316 --> $DIR/matches.rs:199:29
318 199 | (Ok(x), Some(_)) => println!("ok {}", x),
319 | ^^^^^^^^^^^^^^^^^^^^
320 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
322 error: this `match` has identical arm bodies
323 --> $DIR/matches.rs:215:18
325 215 | Ok(_) => println!("ok"),
329 --> $DIR/matches.rs:214:18
331 214 | Ok(3) => println!("ok"),
333 note: consider refactoring into `Ok(3) | Ok(_)`
334 --> $DIR/matches.rs:214:18
336 214 | Ok(3) => println!("ok"),
338 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
340 error: use as_ref() instead
341 --> $DIR/matches.rs:222:33
343 222 | let borrowed: Option<&()> = match owned {
344 | _________________________________^
345 223 | | None => None,
346 224 | | Some(ref v) => Some(v),
348 | |_____^ help: try this: `owned.as_ref()`
350 = note: `-D clippy::match-as-ref` implied by `-D warnings`
352 error: use as_mut() instead
353 --> $DIR/matches.rs:228:39
355 228 | let borrow_mut: Option<&mut ()> = match mut_owned {
356 | _______________________________________^
357 229 | | None => None,
358 230 | | Some(ref mut v) => Some(v),
360 | |_____^ help: try this: `mut_owned.as_mut()`
362 error: aborting due to 26 previous errors