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"),
36 | |_____^ help: try this: `if let &(v, 1) = tup { $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ; } else { $ crate :: io :: _print ( format_args_nl ! ( $ ( $ arg ) * ) ) ; }`
38 error: you don't need to add `&` to all patterns
39 --> $DIR/matches.rs:40:5
42 41 | | &(v, 1) => println!("{}", v),
43 42 | | _ => println!("none"),
46 help: instead of prefixing all patterns with `&`, you can dereference the expression
49 41 | (v, 1) => println!("{}", v),
52 error: you don't need to add `&` to both the expression and the patterns
53 --> $DIR/matches.rs:46:5
56 47 | | &Some(v) => println!("{:?}", v),
57 48 | | &None => println!("none"),
63 47 | Some(v) => println!("{:?}", v),
64 48 | None => println!("none"),
67 error: you don't need to add `&` to all patterns
68 --> $DIR/matches.rs:57:5
70 57 | / if let &None = a {
71 58 | | println!("none");
74 help: instead of prefixing all patterns with `&`, you can dereference the expression
76 57 | if let None = *a {
79 error: you don't need to add `&` to both the expression and the patterns
80 --> $DIR/matches.rs:62:5
82 62 | / if let &None = &b {
83 63 | | println!("none");
88 62 | if let None = b {
91 error: some ranges overlap
92 --> $DIR/matches.rs:71:9
94 71 | 0 ... 10 => println!("0 ... 10"),
97 = note: `-D match-overlapping-arm` implied by `-D warnings`
98 note: overlaps with this
99 --> $DIR/matches.rs:72:9
101 72 | 0 ... 11 => println!("0 ... 11"),
104 error: some ranges overlap
105 --> $DIR/matches.rs:77:9
107 77 | 0 ... 5 => println!("0 ... 5"),
110 note: overlaps with this
111 --> $DIR/matches.rs:79:9
113 79 | FOO ... 11 => println!("0 ... 11"),
116 error: some ranges overlap
117 --> $DIR/matches.rs:85:9
119 85 | 0 ... 5 => println!("0 ... 5"),
122 note: overlaps with this
123 --> $DIR/matches.rs:84:9
125 84 | 2 => println!("2"),
128 error: some ranges overlap
129 --> $DIR/matches.rs:91:9
131 91 | 0 ... 2 => println!("0 ... 2"),
134 note: overlaps with this
135 --> $DIR/matches.rs:90:9
137 90 | 2 => println!("2"),
140 error: some ranges overlap
141 --> $DIR/matches.rs:114:9
143 114 | 0 .. 11 => println!("0 .. 11"),
146 note: overlaps with this
147 --> $DIR/matches.rs:115:9
149 115 | 0 ... 11 => println!("0 ... 11"),
152 error: Err(_) will match all errors, maybe not a good idea
153 --> $DIR/matches.rs:132:9
155 132 | Err(_) => panic!("err")
158 = note: `-D 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:131:18
164 131 | Ok(_) => println!("ok"),
167 = note: `-D match-same-arms` implied by `-D warnings`
169 --> $DIR/matches.rs:130:18
171 130 | Ok(3) => println!("ok"),
173 note: consider refactoring into `Ok(3) | Ok(_)`
174 --> $DIR/matches.rs:130:18
176 130 | 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:138:9
183 138 | 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:137:18
191 137 | Ok(_) => println!("ok"),
195 --> $DIR/matches.rs:136:18
197 136 | Ok(3) => println!("ok"),
199 note: consider refactoring into `Ok(3) | Ok(_)`
200 --> $DIR/matches.rs:136:18
202 136 | 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:144:9
209 144 | 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:143:18
217 143 | Ok(_) => println!("ok"),
221 --> $DIR/matches.rs:142:18
223 142 | Ok(3) => println!("ok"),
225 note: consider refactoring into `Ok(3) | Ok(_)`
226 --> $DIR/matches.rs:142:18
228 142 | 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:150:18
235 150 | Ok(_) => println!("ok"),
239 --> $DIR/matches.rs:149:18
241 149 | Ok(3) => println!("ok"),
243 note: consider refactoring into `Ok(3) | Ok(_)`
244 --> $DIR/matches.rs:149:18
246 149 | 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:157:18
253 157 | Ok(_) => println!("ok"),
257 --> $DIR/matches.rs:156:18
259 156 | Ok(3) => println!("ok"),
261 note: consider refactoring into `Ok(3) | Ok(_)`
262 --> $DIR/matches.rs:156:18
264 156 | 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:163:18
271 163 | Ok(_) => println!("ok"),
275 --> $DIR/matches.rs:162:18
277 162 | Ok(3) => println!("ok"),
279 note: consider refactoring into `Ok(3) | Ok(_)`
280 --> $DIR/matches.rs:162:18
282 162 | 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:169:18
289 169 | Ok(_) => println!("ok"),
293 --> $DIR/matches.rs:168:18
295 168 | Ok(3) => println!("ok"),
297 note: consider refactoring into `Ok(3) | Ok(_)`
298 --> $DIR/matches.rs:168:18
300 168 | 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:190:29
307 190 | (Ok(_), Some(x)) => println!("ok {}", x),
308 | ^^^^^^^^^^^^^^^^^^^^
311 --> $DIR/matches.rs:189:29
313 189 | (Ok(x), Some(_)) => println!("ok {}", x),
314 | ^^^^^^^^^^^^^^^^^^^^
315 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
316 --> $DIR/matches.rs:189:29
318 189 | (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:205:18
325 205 | Ok(_) => println!("ok"),
329 --> $DIR/matches.rs:204:18
331 204 | Ok(3) => println!("ok"),
333 note: consider refactoring into `Ok(3) | Ok(_)`
334 --> $DIR/matches.rs:204:18
336 204 | 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:212:33
343 212 | let borrowed: Option<&()> = match owned {
344 | _________________________________^
345 213 | | None => None,
346 214 | | Some(ref v) => Some(v),
348 | |_____^ help: try this: `owned.as_ref()`
350 = note: `-D match-as-ref` implied by `-D warnings`
352 error: use as_mut() instead
353 --> $DIR/matches.rs:218:39
355 218 | let borrow_mut: Option<&mut ()> = match mut_owned {
356 | _______________________________________^
357 219 | | None => None,
358 220 | | Some(ref mut v) => Some(v),
360 | |_____^ help: try this: `mut_owned.as_mut()`
362 error: aborting due to 26 previous errors