1 error: you don't need to add `&` to all patterns
2 --> $DIR/matches.rs:26:9
5 27 | | &Some(v) => println!("{:?}", v),
6 28 | | &None => println!("none"),
10 = note: `-D clippy::match-ref-pats` implied by `-D warnings`
11 help: instead of prefixing all patterns with `&`, you can dereference the expression
14 27 | Some(v) => println!("{:?}", v),
15 28 | None => println!("none"),
18 error: you don't need to add `&` to all patterns
19 --> $DIR/matches.rs:36:5
22 37 | | &(v, 1) => println!("{}", v),
23 38 | | _ => println!("none"),
26 help: instead of prefixing all patterns with `&`, you can dereference the expression
29 37 | (v, 1) => println!("{}", v),
32 error: you don't need to add `&` to both the expression and the patterns
33 --> $DIR/matches.rs:42:5
36 43 | | &Some(v) => println!("{:?}", v),
37 44 | | &None => println!("none"),
43 43 | Some(v) => println!("{:?}", v),
44 44 | None => println!("none"),
47 error: you don't need to add `&` to all patterns
48 --> $DIR/matches.rs:53:5
50 53 | / if let &None = a {
51 54 | | println!("none");
54 help: instead of prefixing all patterns with `&`, you can dereference the expression
56 53 | if let None = *a {
59 error: you don't need to add `&` to both the expression and the patterns
60 --> $DIR/matches.rs:58:5
62 58 | / if let &None = &b {
63 59 | | println!("none");
68 58 | if let None = b {
71 error: Err(_) will match all errors, maybe not a good idea
72 --> $DIR/matches.rs:69:9
74 69 | Err(_) => panic!("err")
77 = note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
78 = note: to remove this warning, match each error separately or use unreachable macro
80 error: this `match` has identical arm bodies
81 --> $DIR/matches.rs:68:18
83 68 | Ok(_) => println!("ok"),
86 = note: `-D clippy::match-same-arms` implied by `-D warnings`
88 --> $DIR/matches.rs:67:18
90 67 | Ok(3) => println!("ok"),
92 note: consider refactoring into `Ok(3) | Ok(_)`
93 --> $DIR/matches.rs:67:18
95 67 | Ok(3) => println!("ok"),
97 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
99 error: Err(_) will match all errors, maybe not a good idea
100 --> $DIR/matches.rs:75:9
102 75 | Err(_) => {panic!()}
105 = note: to remove this warning, match each error separately or use unreachable macro
107 error: this `match` has identical arm bodies
108 --> $DIR/matches.rs:74:18
110 74 | Ok(_) => println!("ok"),
114 --> $DIR/matches.rs:73:18
116 73 | Ok(3) => println!("ok"),
118 note: consider refactoring into `Ok(3) | Ok(_)`
119 --> $DIR/matches.rs:73:18
121 73 | Ok(3) => println!("ok"),
123 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
125 error: Err(_) will match all errors, maybe not a good idea
126 --> $DIR/matches.rs:81:9
128 81 | Err(_) => {panic!();}
131 = note: to remove this warning, match each error separately or use unreachable macro
133 error: this `match` has identical arm bodies
134 --> $DIR/matches.rs:80:18
136 80 | Ok(_) => println!("ok"),
140 --> $DIR/matches.rs:79:18
142 79 | Ok(3) => println!("ok"),
144 note: consider refactoring into `Ok(3) | Ok(_)`
145 --> $DIR/matches.rs:79:18
147 79 | Ok(3) => println!("ok"),
149 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
151 error: this `match` has identical arm bodies
152 --> $DIR/matches.rs:87:18
154 87 | Ok(_) => println!("ok"),
158 --> $DIR/matches.rs:86:18
160 86 | Ok(3) => println!("ok"),
162 note: consider refactoring into `Ok(3) | Ok(_)`
163 --> $DIR/matches.rs:86:18
165 86 | Ok(3) => println!("ok"),
167 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
169 error: this `match` has identical arm bodies
170 --> $DIR/matches.rs:94:18
172 94 | Ok(_) => println!("ok"),
176 --> $DIR/matches.rs:93:18
178 93 | Ok(3) => println!("ok"),
180 note: consider refactoring into `Ok(3) | Ok(_)`
181 --> $DIR/matches.rs:93:18
183 93 | Ok(3) => println!("ok"),
185 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
187 error: this `match` has identical arm bodies
188 --> $DIR/matches.rs:100:18
190 100 | Ok(_) => println!("ok"),
194 --> $DIR/matches.rs:99:18
196 99 | Ok(3) => println!("ok"),
198 note: consider refactoring into `Ok(3) | Ok(_)`
199 --> $DIR/matches.rs:99:18
201 99 | Ok(3) => println!("ok"),
203 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
205 error: this `match` has identical arm bodies
206 --> $DIR/matches.rs:106:18
208 106 | Ok(_) => println!("ok"),
212 --> $DIR/matches.rs:105:18
214 105 | Ok(3) => println!("ok"),
216 note: consider refactoring into `Ok(3) | Ok(_)`
217 --> $DIR/matches.rs:105:18
219 105 | 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:127:29
226 127 | (Ok(_), Some(x)) => println!("ok {}", x),
227 | ^^^^^^^^^^^^^^^^^^^^
230 --> $DIR/matches.rs:126:29
232 126 | (Ok(x), Some(_)) => println!("ok {}", x),
233 | ^^^^^^^^^^^^^^^^^^^^
234 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
235 --> $DIR/matches.rs:126:29
237 126 | (Ok(x), Some(_)) => println!("ok {}", x),
238 | ^^^^^^^^^^^^^^^^^^^^
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:142:18
244 142 | Ok(_) => println!("ok"),
248 --> $DIR/matches.rs:141:18
250 141 | Ok(3) => println!("ok"),
252 note: consider refactoring into `Ok(3) | Ok(_)`
253 --> $DIR/matches.rs:141:18
255 141 | 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: use as_ref() instead
260 --> $DIR/matches.rs:149:33
262 149 | let borrowed: Option<&()> = match owned {
263 | _________________________________^
264 150 | | None => None,
265 151 | | Some(ref v) => Some(v),
267 | |_____^ help: try this: `owned.as_ref()`
269 = note: `-D clippy::match-as-ref` implied by `-D warnings`
271 error: use as_mut() instead
272 --> $DIR/matches.rs:155:39
274 155 | let borrow_mut: Option<&mut ()> = match mut_owned {
275 | _______________________________________^
276 156 | | None => None,
277 157 | | Some(ref mut v) => Some(v),
279 | |_____^ help: try this: `mut_owned.as_mut()`
281 error: aborting due to 19 previous errors