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: Err(_) will match all errors, maybe not a good idea
92 --> $DIR/matches.rs:83:9
94 83 | Err(_) => panic!("err")
97 = note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
98 = note: to remove this warning, match each error separately or use unreachable macro
100 error: this `match` has identical arm bodies
101 --> $DIR/matches.rs:82:18
103 82 | Ok(_) => println!("ok"),
106 = note: `-D clippy::match-same-arms` implied by `-D warnings`
108 --> $DIR/matches.rs:81:18
110 81 | Ok(3) => println!("ok"),
112 note: consider refactoring into `Ok(3) | Ok(_)`
113 --> $DIR/matches.rs:81:18
115 81 | Ok(3) => println!("ok"),
117 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
119 error: Err(_) will match all errors, maybe not a good idea
120 --> $DIR/matches.rs:89:9
122 89 | Err(_) => {panic!()}
125 = note: to remove this warning, match each error separately or use unreachable macro
127 error: this `match` has identical arm bodies
128 --> $DIR/matches.rs:88:18
130 88 | Ok(_) => println!("ok"),
134 --> $DIR/matches.rs:87:18
136 87 | Ok(3) => println!("ok"),
138 note: consider refactoring into `Ok(3) | Ok(_)`
139 --> $DIR/matches.rs:87:18
141 87 | Ok(3) => println!("ok"),
143 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
145 error: Err(_) will match all errors, maybe not a good idea
146 --> $DIR/matches.rs:95:9
148 95 | Err(_) => {panic!();}
151 = note: to remove this warning, match each error separately or use unreachable macro
153 error: this `match` has identical arm bodies
154 --> $DIR/matches.rs:94:18
156 94 | Ok(_) => println!("ok"),
160 --> $DIR/matches.rs:93:18
162 93 | Ok(3) => println!("ok"),
164 note: consider refactoring into `Ok(3) | Ok(_)`
165 --> $DIR/matches.rs:93:18
167 93 | 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: this `match` has identical arm bodies
172 --> $DIR/matches.rs:101:18
174 101 | Ok(_) => println!("ok"),
178 --> $DIR/matches.rs:100:18
180 100 | Ok(3) => println!("ok"),
182 note: consider refactoring into `Ok(3) | Ok(_)`
183 --> $DIR/matches.rs:100:18
185 100 | Ok(3) => println!("ok"),
187 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
189 error: this `match` has identical arm bodies
190 --> $DIR/matches.rs:108:18
192 108 | Ok(_) => println!("ok"),
196 --> $DIR/matches.rs:107:18
198 107 | Ok(3) => println!("ok"),
200 note: consider refactoring into `Ok(3) | Ok(_)`
201 --> $DIR/matches.rs:107:18
203 107 | Ok(3) => println!("ok"),
205 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
207 error: this `match` has identical arm bodies
208 --> $DIR/matches.rs:114:18
210 114 | Ok(_) => println!("ok"),
214 --> $DIR/matches.rs:113:18
216 113 | Ok(3) => println!("ok"),
218 note: consider refactoring into `Ok(3) | Ok(_)`
219 --> $DIR/matches.rs:113:18
221 113 | Ok(3) => println!("ok"),
223 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
225 error: this `match` has identical arm bodies
226 --> $DIR/matches.rs:120:18
228 120 | Ok(_) => println!("ok"),
232 --> $DIR/matches.rs:119:18
234 119 | Ok(3) => println!("ok"),
236 note: consider refactoring into `Ok(3) | Ok(_)`
237 --> $DIR/matches.rs:119:18
239 119 | 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: this `match` has identical arm bodies
244 --> $DIR/matches.rs:141:29
246 141 | (Ok(_), Some(x)) => println!("ok {}", x),
247 | ^^^^^^^^^^^^^^^^^^^^
250 --> $DIR/matches.rs:140:29
252 140 | (Ok(x), Some(_)) => println!("ok {}", x),
253 | ^^^^^^^^^^^^^^^^^^^^
254 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
255 --> $DIR/matches.rs:140:29
257 140 | (Ok(x), Some(_)) => println!("ok {}", x),
258 | ^^^^^^^^^^^^^^^^^^^^
259 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
261 error: this `match` has identical arm bodies
262 --> $DIR/matches.rs:156:18
264 156 | Ok(_) => println!("ok"),
268 --> $DIR/matches.rs:155:18
270 155 | Ok(3) => println!("ok"),
272 note: consider refactoring into `Ok(3) | Ok(_)`
273 --> $DIR/matches.rs:155:18
275 155 | Ok(3) => println!("ok"),
277 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
279 error: use as_ref() instead
280 --> $DIR/matches.rs:163:33
282 163 | let borrowed: Option<&()> = match owned {
283 | _________________________________^
284 164 | | None => None,
285 165 | | Some(ref v) => Some(v),
287 | |_____^ help: try this: `owned.as_ref()`
289 = note: `-D clippy::match-as-ref` implied by `-D warnings`
291 error: use as_mut() instead
292 --> $DIR/matches.rs:169:39
294 169 | let borrow_mut: Option<&mut ()> = match mut_owned {
295 | _______________________________________^
296 170 | | None => None,
297 171 | | Some(ref mut v) => Some(v),
299 | |_____^ help: try this: `mut_owned.as_mut()`
301 error: aborting due to 21 previous errors