1 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
2 --> $DIR/matches.rs:21:5
4 21 | / match ExprNode::Butterflies {
5 22 | | ExprNode::ExprAddrOf => Some(&NODE),
6 23 | | _ => { let x = 5; None },
8 | |_____^ help: try this: `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
10 = note: `-D single-match-else` implied by `-D warnings`
12 error: this boolean expression can be simplified
13 --> $DIR/matches.rs:51:11
15 51 | match test && test {
16 | ^^^^^^^^^^^^ help: try: `test`
18 = note: `-D nonminimal-bool` implied by `-D warnings`
20 error: you seem to be trying to match on a boolean expression
21 --> $DIR/matches.rs:30:5
27 | |_____^ help: consider using an if/else expression: `if test { 0 } else { 42 }`
29 = note: `-D match-bool` implied by `-D warnings`
31 error: you seem to be trying to match on a boolean expression
32 --> $DIR/matches.rs:36:5
34 36 | / match option == 1 {
38 | |_____^ help: consider using an if/else expression: `if option == 1 { 1 } else { 0 }`
40 error: you seem to be trying to match on a boolean expression
41 --> $DIR/matches.rs:41:5
45 43 | | false => { println!("Noooo!"); }
47 | |_____^ help: consider using an if/else expression: `if !test { println!("Noooo!"); }`
49 error: you seem to be trying to match on a boolean expression
50 --> $DIR/matches.rs:46:5
53 47 | | false => { println!("Noooo!"); }
56 | |_____^ help: consider using an if/else expression: `if !test { println!("Noooo!"); }`
58 error: you seem to be trying to match on a boolean expression
59 --> $DIR/matches.rs:51:5
61 51 | / match test && test {
62 52 | | false => { println!("Noooo!"); }
65 | |_____^ help: consider using an if/else expression: `if !(test && test) { println!("Noooo!"); }`
67 error: equal expressions as operands to `&&`
68 --> $DIR/matches.rs:51:11
70 51 | match test && test {
73 = note: `-D eq-op` implied by `-D warnings`
75 error: you seem to be trying to match on a boolean expression
76 --> $DIR/matches.rs:56:5
79 57 | | false => { println!("Noooo!"); }
80 58 | | true => { println!("Yes!"); }
82 | |_____^ help: consider using an if/else expression: `if test { println!("Yes!"); } else { println!("Noooo!"); }`
84 error: you don't need to add `&` to all patterns
85 --> $DIR/matches.rs:72:9
88 73 | | &Some(v) => println!("{:?}", v),
89 74 | | &None => println!("none"),
93 = note: `-D match-ref-pats` implied by `-D warnings`
94 help: instead of prefixing all patterns with `&`, you can dereference the expression
97 73 | Some(v) => println!("{:?}", v),
98 74 | None => println!("none"),
101 error: you don't need to add `&` to all patterns
102 --> $DIR/matches.rs:82:5
105 83 | | &(v, 1) => println!("{}", v),
106 84 | | _ => println!("none"),
109 help: instead of prefixing all patterns with `&`, you can dereference the expression
112 83 | (v, 1) => println!("{}", v),
115 error: you don't need to add `&` to both the expression and the patterns
116 --> $DIR/matches.rs:88:5
119 89 | | &Some(v) => println!("{:?}", v),
120 90 | | &None => println!("none"),
126 89 | Some(v) => println!("{:?}", v),
127 90 | None => println!("none"),
130 error: you don't need to add `&` to all patterns
131 --> $DIR/matches.rs:99:5
133 99 | / if let &None = a {
134 100 | | println!("none");
137 help: instead of prefixing all patterns with `&`, you can dereference the expression
139 99 | if let None = *a {
142 error: you don't need to add `&` to both the expression and the patterns
143 --> $DIR/matches.rs:104:5
145 104 | / if let &None = &b {
146 105 | | println!("none");
151 104 | if let None = b {
154 error: some ranges overlap
155 --> $DIR/matches.rs:113:9
157 113 | 0 ... 10 => println!("0 ... 10"),
160 = note: `-D match-overlapping-arm` implied by `-D warnings`
161 note: overlaps with this
162 --> $DIR/matches.rs:114:9
164 114 | 0 ... 11 => println!("0 ... 11"),
167 error: some ranges overlap
168 --> $DIR/matches.rs:119:9
170 119 | 0 ... 5 => println!("0 ... 5"),
173 note: overlaps with this
174 --> $DIR/matches.rs:121:9
176 121 | FOO ... 11 => println!("0 ... 11"),
179 error: some ranges overlap
180 --> $DIR/matches.rs:127:9
182 127 | 0 ... 5 => println!("0 ... 5"),
185 note: overlaps with this
186 --> $DIR/matches.rs:126:9
188 126 | 2 => println!("2"),
191 error: some ranges overlap
192 --> $DIR/matches.rs:133:9
194 133 | 0 ... 2 => println!("0 ... 2"),
197 note: overlaps with this
198 --> $DIR/matches.rs:132:9
200 132 | 2 => println!("2"),
203 error: some ranges overlap
204 --> $DIR/matches.rs:156:9
206 156 | 0 .. 11 => println!("0 .. 11"),
209 note: overlaps with this
210 --> $DIR/matches.rs:157:9
212 157 | 0 ... 11 => println!("0 ... 11"),
215 error: Err(_) will match all errors, maybe not a good idea
216 --> $DIR/matches.rs:174:9
218 174 | Err(_) => panic!("err")
221 = note: `-D match-wild-err-arm` implied by `-D warnings`
222 = note: to remove this warning, match each error seperately or use unreachable macro
224 error: this `match` has identical arm bodies
225 --> $DIR/matches.rs:173:18
227 173 | Ok(_) => println!("ok"),
230 = note: `-D match-same-arms` implied by `-D warnings`
232 --> $DIR/matches.rs:172:18
234 172 | Ok(3) => println!("ok"),
236 note: consider refactoring into `Ok(3) | Ok(_)`
237 --> $DIR/matches.rs:172:18
239 172 | Ok(3) => println!("ok"),
241 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
243 error: Err(_) will match all errors, maybe not a good idea
244 --> $DIR/matches.rs:180:9
246 180 | Err(_) => {panic!()}
249 = note: to remove this warning, match each error seperately or use unreachable macro
251 error: this `match` has identical arm bodies
252 --> $DIR/matches.rs:179:18
254 179 | Ok(_) => println!("ok"),
258 --> $DIR/matches.rs:178:18
260 178 | Ok(3) => println!("ok"),
262 note: consider refactoring into `Ok(3) | Ok(_)`
263 --> $DIR/matches.rs:178:18
265 178 | Ok(3) => println!("ok"),
267 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
269 error: Err(_) will match all errors, maybe not a good idea
270 --> $DIR/matches.rs:186:9
272 186 | Err(_) => {panic!();}
275 = note: to remove this warning, match each error seperately or use unreachable macro
277 error: this `match` has identical arm bodies
278 --> $DIR/matches.rs:185:18
280 185 | Ok(_) => println!("ok"),
284 --> $DIR/matches.rs:184:18
286 184 | Ok(3) => println!("ok"),
288 note: consider refactoring into `Ok(3) | Ok(_)`
289 --> $DIR/matches.rs:184:18
291 184 | Ok(3) => println!("ok"),
293 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
295 error: this `match` has identical arm bodies
296 --> $DIR/matches.rs:192:18
298 192 | Ok(_) => println!("ok"),
302 --> $DIR/matches.rs:191:18
304 191 | Ok(3) => println!("ok"),
306 note: consider refactoring into `Ok(3) | Ok(_)`
307 --> $DIR/matches.rs:191:18
309 191 | Ok(3) => println!("ok"),
311 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
313 error: this `match` has identical arm bodies
314 --> $DIR/matches.rs:199:18
316 199 | Ok(_) => println!("ok"),
320 --> $DIR/matches.rs:198:18
322 198 | Ok(3) => println!("ok"),
324 note: consider refactoring into `Ok(3) | Ok(_)`
325 --> $DIR/matches.rs:198:18
327 198 | Ok(3) => println!("ok"),
329 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
331 error: this `match` has identical arm bodies
332 --> $DIR/matches.rs:205:18
334 205 | Ok(_) => println!("ok"),
338 --> $DIR/matches.rs:204:18
340 204 | Ok(3) => println!("ok"),
342 note: consider refactoring into `Ok(3) | Ok(_)`
343 --> $DIR/matches.rs:204:18
345 204 | Ok(3) => println!("ok"),
347 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
349 error: this `match` has identical arm bodies
350 --> $DIR/matches.rs:211:18
352 211 | Ok(_) => println!("ok"),
356 --> $DIR/matches.rs:210:18
358 210 | Ok(3) => println!("ok"),
360 note: consider refactoring into `Ok(3) | Ok(_)`
361 --> $DIR/matches.rs:210:18
363 210 | Ok(3) => println!("ok"),
365 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
367 error: this `match` has identical arm bodies
368 --> $DIR/matches.rs:232:29
370 232 | (Ok(_), Some(x)) => println!("ok {}", x),
371 | ^^^^^^^^^^^^^^^^^^^^
374 --> $DIR/matches.rs:231:29
376 231 | (Ok(x), Some(_)) => println!("ok {}", x),
377 | ^^^^^^^^^^^^^^^^^^^^
378 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
379 --> $DIR/matches.rs:231:29
381 231 | (Ok(x), Some(_)) => println!("ok {}", x),
382 | ^^^^^^^^^^^^^^^^^^^^
383 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
385 error: this `match` has identical arm bodies
386 --> $DIR/matches.rs:247:18
388 247 | Ok(_) => println!("ok"),
392 --> $DIR/matches.rs:246:18
394 246 | Ok(3) => println!("ok"),
396 note: consider refactoring into `Ok(3) | Ok(_)`
397 --> $DIR/matches.rs:246:18
399 246 | Ok(3) => println!("ok"),
401 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
403 error: use as_ref() instead
404 --> $DIR/matches.rs:254:33
406 254 | let borrowed: Option<&()> = match owned {
407 | _________________________________^
408 255 | | None => None,
409 256 | | Some(ref v) => Some(v),
411 | |_____^ help: try this: `owned.as_ref()`
413 = note: `-D match-as-ref` implied by `-D warnings`
415 error: use as_mut() instead
416 --> $DIR/matches.rs:260:39
418 260 | let borrow_mut: Option<&mut ()> = match mut_owned {
419 | _______________________________________^
420 261 | | None => None,
421 262 | | Some(ref mut v) => Some(v),
423 | |_____^ help: try this: `mut_owned.as_mut()`
425 error: aborting due to 33 previous errors