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: you don't need to add `&` to all patterns
13 --> $DIR/matches.rs:30:9
16 31 | | &Some(v) => println!("{:?}", v),
17 32 | | &None => println!("none"),
21 = note: `-D match-ref-pats` implied by `-D warnings`
22 help: instead of prefixing all patterns with `&`, you can dereference the expression
25 31 | Some(v) => println!("{:?}", v),
26 32 | 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:40:5
33 41 | | &(v, 1) => println!("{}", v),
34 42 | | _ => println!("none"),
39 40 | if let &(v, 1) = tup {
40 41 | # [ cfg ( not ( stage0 ) ) ] {
41 42 | ( $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ) ; } # [
42 43 | cfg ( stage0 ) ] { print ! ( "{}/n" , format_args ! ( $ ( $ arg ) * ) ) } } else {
43 44 | ( $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ) ; }
46 error: you don't need to add `&` to all patterns
47 --> $DIR/matches.rs:40:5
50 41 | | &(v, 1) => println!("{}", v),
51 42 | | _ => println!("none"),
54 help: instead of prefixing all patterns with `&`, you can dereference the expression
57 41 | (v, 1) => println!("{}", v),
60 error: you don't need to add `&` to both the expression and the patterns
61 --> $DIR/matches.rs:46:5
64 47 | | &Some(v) => println!("{:?}", v),
65 48 | | &None => println!("none"),
71 47 | Some(v) => println!("{:?}", v),
72 48 | None => println!("none"),
75 error: you don't need to add `&` to all patterns
76 --> $DIR/matches.rs:57:5
78 57 | / if let &None = a {
79 58 | | println!("none");
82 help: instead of prefixing all patterns with `&`, you can dereference the expression
84 57 | if let None = *a {
87 error: you don't need to add `&` to both the expression and the patterns
88 --> $DIR/matches.rs:62:5
90 62 | / if let &None = &b {
91 63 | | println!("none");
96 62 | if let None = b {
99 error: some ranges overlap
100 --> $DIR/matches.rs:71:9
102 71 | 0 ... 10 => println!("0 ... 10"),
105 = note: `-D match-overlapping-arm` implied by `-D warnings`
106 note: overlaps with this
107 --> $DIR/matches.rs:72:9
109 72 | 0 ... 11 => println!("0 ... 11"),
112 error: some ranges overlap
113 --> $DIR/matches.rs:77:9
115 77 | 0 ... 5 => println!("0 ... 5"),
118 note: overlaps with this
119 --> $DIR/matches.rs:79:9
121 79 | FOO ... 11 => println!("0 ... 11"),
124 error: some ranges overlap
125 --> $DIR/matches.rs:85:9
127 85 | 0 ... 5 => println!("0 ... 5"),
130 note: overlaps with this
131 --> $DIR/matches.rs:84:9
133 84 | 2 => println!("2"),
136 error: some ranges overlap
137 --> $DIR/matches.rs:91:9
139 91 | 0 ... 2 => println!("0 ... 2"),
142 note: overlaps with this
143 --> $DIR/matches.rs:90:9
145 90 | 2 => println!("2"),
148 error: some ranges overlap
149 --> $DIR/matches.rs:114:9
151 114 | 0 .. 11 => println!("0 .. 11"),
154 note: overlaps with this
155 --> $DIR/matches.rs:115:9
157 115 | 0 ... 11 => println!("0 ... 11"),
160 error: Err(_) will match all errors, maybe not a good idea
161 --> $DIR/matches.rs:132:9
163 132 | Err(_) => panic!("err")
166 = note: `-D match-wild-err-arm` implied by `-D warnings`
167 = note: to remove this warning, match each error seperately or use unreachable macro
169 error: this `match` has identical arm bodies
170 --> $DIR/matches.rs:131:18
172 131 | Ok(_) => println!("ok"),
175 = note: `-D match-same-arms` implied by `-D warnings`
177 --> $DIR/matches.rs:130:18
179 130 | Ok(3) => println!("ok"),
181 note: consider refactoring into `Ok(3) | Ok(_)`
182 --> $DIR/matches.rs:130:18
184 130 | Ok(3) => println!("ok"),
186 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
188 error: Err(_) will match all errors, maybe not a good idea
189 --> $DIR/matches.rs:138:9
191 138 | Err(_) => {panic!()}
194 = note: to remove this warning, match each error seperately or use unreachable macro
196 error: this `match` has identical arm bodies
197 --> $DIR/matches.rs:137:18
199 137 | Ok(_) => println!("ok"),
203 --> $DIR/matches.rs:136:18
205 136 | Ok(3) => println!("ok"),
207 note: consider refactoring into `Ok(3) | Ok(_)`
208 --> $DIR/matches.rs:136:18
210 136 | Ok(3) => println!("ok"),
212 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
214 error: Err(_) will match all errors, maybe not a good idea
215 --> $DIR/matches.rs:144:9
217 144 | Err(_) => {panic!();}
220 = note: to remove this warning, match each error seperately or use unreachable macro
222 error: this `match` has identical arm bodies
223 --> $DIR/matches.rs:143:18
225 143 | Ok(_) => println!("ok"),
229 --> $DIR/matches.rs:142:18
231 142 | Ok(3) => println!("ok"),
233 note: consider refactoring into `Ok(3) | Ok(_)`
234 --> $DIR/matches.rs:142:18
236 142 | Ok(3) => println!("ok"),
238 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
240 error: this `match` has identical arm bodies
241 --> $DIR/matches.rs:150:18
243 150 | Ok(_) => println!("ok"),
247 --> $DIR/matches.rs:149:18
249 149 | Ok(3) => println!("ok"),
251 note: consider refactoring into `Ok(3) | Ok(_)`
252 --> $DIR/matches.rs:149:18
254 149 | Ok(3) => println!("ok"),
256 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
258 error: this `match` has identical arm bodies
259 --> $DIR/matches.rs:157:18
261 157 | Ok(_) => println!("ok"),
265 --> $DIR/matches.rs:156:18
267 156 | Ok(3) => println!("ok"),
269 note: consider refactoring into `Ok(3) | Ok(_)`
270 --> $DIR/matches.rs:156:18
272 156 | Ok(3) => println!("ok"),
274 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
276 error: this `match` has identical arm bodies
277 --> $DIR/matches.rs:163:18
279 163 | Ok(_) => println!("ok"),
283 --> $DIR/matches.rs:162:18
285 162 | Ok(3) => println!("ok"),
287 note: consider refactoring into `Ok(3) | Ok(_)`
288 --> $DIR/matches.rs:162:18
290 162 | Ok(3) => println!("ok"),
292 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
294 error: this `match` has identical arm bodies
295 --> $DIR/matches.rs:169:18
297 169 | Ok(_) => println!("ok"),
301 --> $DIR/matches.rs:168:18
303 168 | Ok(3) => println!("ok"),
305 note: consider refactoring into `Ok(3) | Ok(_)`
306 --> $DIR/matches.rs:168:18
308 168 | Ok(3) => println!("ok"),
310 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
312 error: this `match` has identical arm bodies
313 --> $DIR/matches.rs:190:29
315 190 | (Ok(_), Some(x)) => println!("ok {}", x),
316 | ^^^^^^^^^^^^^^^^^^^^
319 --> $DIR/matches.rs:189:29
321 189 | (Ok(x), Some(_)) => println!("ok {}", x),
322 | ^^^^^^^^^^^^^^^^^^^^
323 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
324 --> $DIR/matches.rs:189:29
326 189 | (Ok(x), Some(_)) => println!("ok {}", x),
327 | ^^^^^^^^^^^^^^^^^^^^
328 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
330 error: this `match` has identical arm bodies
331 --> $DIR/matches.rs:205:18
333 205 | Ok(_) => println!("ok"),
337 --> $DIR/matches.rs:204:18
339 204 | Ok(3) => println!("ok"),
341 note: consider refactoring into `Ok(3) | Ok(_)`
342 --> $DIR/matches.rs:204:18
344 204 | Ok(3) => println!("ok"),
346 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
348 error: use as_ref() instead
349 --> $DIR/matches.rs:212:33
351 212 | let borrowed: Option<&()> = match owned {
352 | _________________________________^
353 213 | | None => None,
354 214 | | Some(ref v) => Some(v),
356 | |_____^ help: try this: `owned.as_ref()`
358 = note: `-D match-as-ref` implied by `-D warnings`
360 error: use as_mut() instead
361 --> $DIR/matches.rs:218:39
363 218 | let borrow_mut: Option<&mut ()> = match mut_owned {
364 | _______________________________________^
365 219 | | None => None,
366 220 | | Some(ref mut v) => Some(v),
368 | |_____^ help: try this: `mut_owned.as_mut()`
370 error: aborting due to 26 previous errors