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 don't need to add `&` to all patterns
30 --> $DIR/matches.rs:40:5
33 41 | | &(v, 1) => println!("{}", v),
34 42 | | _ => println!("none"),
37 help: instead of prefixing all patterns with `&`, you can dereference the expression
40 41 | (v, 1) => println!("{}", v),
43 error: you don't need to add `&` to both the expression and the patterns
44 --> $DIR/matches.rs:46:5
47 47 | | &Some(v) => println!("{:?}", v),
48 48 | | &None => println!("none"),
54 47 | Some(v) => println!("{:?}", v),
55 48 | None => println!("none"),
58 error: you don't need to add `&` to all patterns
59 --> $DIR/matches.rs:57:5
61 57 | / if let &None = a {
62 58 | | println!("none");
65 help: instead of prefixing all patterns with `&`, you can dereference the expression
67 57 | if let None = *a {
70 error: you don't need to add `&` to both the expression and the patterns
71 --> $DIR/matches.rs:62:5
73 62 | / if let &None = &b {
74 63 | | println!("none");
79 62 | if let None = b {
82 error: some ranges overlap
83 --> $DIR/matches.rs:71:9
85 71 | 0 ... 10 => println!("0 ... 10"),
88 = note: `-D match-overlapping-arm` implied by `-D warnings`
89 note: overlaps with this
90 --> $DIR/matches.rs:72:9
92 72 | 0 ... 11 => println!("0 ... 11"),
95 error: some ranges overlap
96 --> $DIR/matches.rs:77:9
98 77 | 0 ... 5 => println!("0 ... 5"),
101 note: overlaps with this
102 --> $DIR/matches.rs:79:9
104 79 | FOO ... 11 => println!("0 ... 11"),
107 error: some ranges overlap
108 --> $DIR/matches.rs:85:9
110 85 | 0 ... 5 => println!("0 ... 5"),
113 note: overlaps with this
114 --> $DIR/matches.rs:84:9
116 84 | 2 => println!("2"),
119 error: some ranges overlap
120 --> $DIR/matches.rs:91:9
122 91 | 0 ... 2 => println!("0 ... 2"),
125 note: overlaps with this
126 --> $DIR/matches.rs:90:9
128 90 | 2 => println!("2"),
131 error: some ranges overlap
132 --> $DIR/matches.rs:114:9
134 114 | 0 .. 11 => println!("0 .. 11"),
137 note: overlaps with this
138 --> $DIR/matches.rs:115:9
140 115 | 0 ... 11 => println!("0 ... 11"),
143 error: Err(_) will match all errors, maybe not a good idea
144 --> $DIR/matches.rs:132:9
146 132 | Err(_) => panic!("err")
149 = note: `-D match-wild-err-arm` implied by `-D warnings`
150 = note: to remove this warning, match each error seperately or use unreachable macro
152 error: this `match` has identical arm bodies
153 --> $DIR/matches.rs:131:18
155 131 | Ok(_) => println!("ok"),
158 = note: `-D match-same-arms` implied by `-D warnings`
160 --> $DIR/matches.rs:130:18
162 130 | Ok(3) => println!("ok"),
164 note: consider refactoring into `Ok(3) | Ok(_)`
165 --> $DIR/matches.rs:130:18
167 130 | Ok(3) => println!("ok"),
169 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
171 error: Err(_) will match all errors, maybe not a good idea
172 --> $DIR/matches.rs:138:9
174 138 | Err(_) => {panic!()}
177 = note: to remove this warning, match each error seperately or use unreachable macro
179 error: this `match` has identical arm bodies
180 --> $DIR/matches.rs:137:18
182 137 | Ok(_) => println!("ok"),
186 --> $DIR/matches.rs:136:18
188 136 | Ok(3) => println!("ok"),
190 note: consider refactoring into `Ok(3) | Ok(_)`
191 --> $DIR/matches.rs:136:18
193 136 | Ok(3) => println!("ok"),
195 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
197 error: Err(_) will match all errors, maybe not a good idea
198 --> $DIR/matches.rs:144:9
200 144 | Err(_) => {panic!();}
203 = note: to remove this warning, match each error seperately or use unreachable macro
205 error: this `match` has identical arm bodies
206 --> $DIR/matches.rs:143:18
208 143 | Ok(_) => println!("ok"),
212 --> $DIR/matches.rs:142:18
214 142 | Ok(3) => println!("ok"),
216 note: consider refactoring into `Ok(3) | Ok(_)`
217 --> $DIR/matches.rs:142:18
219 142 | Ok(3) => println!("ok"),
221 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
223 error: this `match` has identical arm bodies
224 --> $DIR/matches.rs:150:18
226 150 | Ok(_) => println!("ok"),
230 --> $DIR/matches.rs:149:18
232 149 | Ok(3) => println!("ok"),
234 note: consider refactoring into `Ok(3) | Ok(_)`
235 --> $DIR/matches.rs:149:18
237 149 | Ok(3) => println!("ok"),
239 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
241 error: this `match` has identical arm bodies
242 --> $DIR/matches.rs:157:18
244 157 | Ok(_) => println!("ok"),
248 --> $DIR/matches.rs:156:18
250 156 | Ok(3) => println!("ok"),
252 note: consider refactoring into `Ok(3) | Ok(_)`
253 --> $DIR/matches.rs:156:18
255 156 | Ok(3) => println!("ok"),
257 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
259 error: this `match` has identical arm bodies
260 --> $DIR/matches.rs:163:18
262 163 | Ok(_) => println!("ok"),
266 --> $DIR/matches.rs:162:18
268 162 | Ok(3) => println!("ok"),
270 note: consider refactoring into `Ok(3) | Ok(_)`
271 --> $DIR/matches.rs:162:18
273 162 | Ok(3) => println!("ok"),
275 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
277 error: this `match` has identical arm bodies
278 --> $DIR/matches.rs:169:18
280 169 | Ok(_) => println!("ok"),
284 --> $DIR/matches.rs:168:18
286 168 | Ok(3) => println!("ok"),
288 note: consider refactoring into `Ok(3) | Ok(_)`
289 --> $DIR/matches.rs:168:18
291 168 | 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:190:29
298 190 | (Ok(_), Some(x)) => println!("ok {}", x),
299 | ^^^^^^^^^^^^^^^^^^^^
302 --> $DIR/matches.rs:189:29
304 189 | (Ok(x), Some(_)) => println!("ok {}", x),
305 | ^^^^^^^^^^^^^^^^^^^^
306 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
307 --> $DIR/matches.rs:189:29
309 189 | (Ok(x), Some(_)) => println!("ok {}", x),
310 | ^^^^^^^^^^^^^^^^^^^^
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:205:18
316 205 | Ok(_) => println!("ok"),
320 --> $DIR/matches.rs:204:18
322 204 | Ok(3) => println!("ok"),
324 note: consider refactoring into `Ok(3) | Ok(_)`
325 --> $DIR/matches.rs:204:18
327 204 | 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: use as_ref() instead
332 --> $DIR/matches.rs:212:33
334 212 | let borrowed: Option<&()> = match owned {
335 | _________________________________^
336 213 | | None => None,
337 214 | | Some(ref v) => Some(v),
339 | |_____^ help: try this: `owned.as_ref()`
341 = note: `-D match-as-ref` implied by `-D warnings`
343 error: use as_mut() instead
344 --> $DIR/matches.rs:218:39
346 218 | let borrow_mut: Option<&mut ()> = match mut_owned {
347 | _______________________________________^
348 219 | | None => None,
349 220 | | Some(ref mut v) => Some(v),
351 | |_____^ help: try this: `mut_owned.as_mut()`
353 error: aborting due to 25 previous errors