]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/matches.stderr
Fix the test suite after cargo update
[rust.git] / clippy_tests / examples / matches.stderr
1 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
2   --> matches.rs:26:5
3    |
4 26 | /     match ExprNode::Butterflies {
5 27 | |         ExprNode::ExprAddrOf => Some(&NODE),
6 28 | |         _ => { let x = 5; None },
7 29 | |     }
8    | |_____^ help: try this `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
9    |
10    = note: `-D single-match-else` implied by `-D warnings`
11
12 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
13   --> matches.rs:35:5
14    |
15 35 | /     match x {
16 36 | |         Some(y) => { println!("{:?}", y); }
17 37 | |         _ => ()
18 38 | |     };
19    | |_____^ help: try this `if let Some(y) = x { println!("{:?}", y); }`
20    |
21    = note: `-D single-match` implied by `-D warnings`
22
23 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
24   --> matches.rs:41:5
25    |
26 41 | /     match z {
27 42 | |         (2...3, 7...9) => dummy(),
28 43 | |         _ => {}
29 44 | |     };
30    | |_____^ help: try this `if let (2...3, 7...9) = z { dummy() }`
31    |
32    = note: `-D single-match` implied by `-D warnings`
33
34 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
35   --> matches.rs:63:5
36    |
37 63 | /     match x {
38 64 | |         Some(y) => dummy(),
39 65 | |         None => ()
40 66 | |     };
41    | |_____^ help: try this `if let Some(y) = x { dummy() }`
42    |
43    = note: `-D single-match` implied by `-D warnings`
44
45 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
46   --> matches.rs:68:5
47    |
48 68 | /     match y {
49 69 | |         Ok(y) => dummy(),
50 70 | |         Err(..) => ()
51 71 | |     };
52    | |_____^ help: try this `if let Ok(y) = y { dummy() }`
53    |
54    = note: `-D single-match` implied by `-D warnings`
55
56 error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
57   --> matches.rs:75:5
58    |
59 75 | /     match c {
60 76 | |         Cow::Borrowed(..) => dummy(),
61 77 | |         Cow::Owned(..) => (),
62 78 | |     };
63    | |_____^ help: try this `if let Cow::Borrowed(..) = c { dummy() }`
64    |
65    = note: `-D single-match` implied by `-D warnings`
66
67 error: you seem to be trying to match on a boolean expression
68   --> matches.rs:96:5
69    |
70 96 | /     match test {
71 97 | |         true => 0,
72 98 | |         false => 42,
73 99 | |     };
74    | |_____^ help: consider using an if/else expression `if test { 0 } else { 42 }`
75    |
76    = note: `-D match-bool` implied by `-D warnings`
77
78 error: you seem to be trying to match on a boolean expression
79    --> matches.rs:102:5
80     |
81 102 | /     match option == 1 {
82 103 | |         true => 1,
83 104 | |         false => 0,
84 105 | |     };
85     | |_____^ help: consider using an if/else expression `if option == 1 { 1 } else { 0 }`
86     |
87     = note: `-D match-bool` implied by `-D warnings`
88
89 error: you seem to be trying to match on a boolean expression
90    --> matches.rs:107:5
91     |
92 107 | /     match test {
93 108 | |         true => (),
94 109 | |         false => { println!("Noooo!"); }
95 110 | |     };
96     | |_____^ help: consider using an if/else expression `if !test { println!("Noooo!"); }`
97     |
98     = note: `-D match-bool` implied by `-D warnings`
99
100 error: you seem to be trying to match on a boolean expression
101    --> matches.rs:112:5
102     |
103 112 | /     match test {
104 113 | |         false => { println!("Noooo!"); }
105 114 | |         _ => (),
106 115 | |     };
107     | |_____^ help: consider using an if/else expression `if !test { println!("Noooo!"); }`
108     |
109     = note: `-D match-bool` implied by `-D warnings`
110
111 error: you seem to be trying to match on a boolean expression
112    --> matches.rs:117:5
113     |
114 117 | /     match test && test {
115 118 | |         false => { println!("Noooo!"); }
116 119 | |         _ => (),
117 120 | |     };
118     | |_____^ help: consider using an if/else expression `if !(test && test) { println!("Noooo!"); }`
119     |
120     = note: `-D match-bool` implied by `-D warnings`
121
122 error: equal expressions as operands to `&&`
123    --> matches.rs:117:11
124     |
125 117 |     match test && test {
126     |           ^^^^^^^^^^^^
127     |
128     = note: `-D eq-op` implied by `-D warnings`
129
130 error: you seem to be trying to match on a boolean expression
131    --> matches.rs:122:5
132     |
133 122 | /     match test {
134 123 | |         false => { println!("Noooo!"); }
135 124 | |         true => { println!("Yes!"); }
136 125 | |     };
137     | |_____^ help: consider using an if/else expression `if test { println!("Yes!"); } else { println!("Noooo!"); }`
138     |
139     = note: `-D match-bool` implied by `-D warnings`
140
141 error: you don't need to add `&` to all patterns
142    --> matches.rs:138:9
143     |
144 138 | /         match v {
145 139 | |             &Some(v) => println!("{:?}", v),
146 140 | |             &None => println!("none"),
147 141 | |         }
148     | |_________^
149     |
150     = note: `-D match-ref-pats` implied by `-D warnings`
151 help: instead of prefixing all patterns with `&`, you can dereference the expression
152     |         match *v { .. }
153
154 error: you don't need to add `&` to all patterns
155    --> matches.rs:148:5
156     |
157 148 | /     match tup {
158 149 | |         &(v, 1) => println!("{}", v),
159 150 | |         _ => println!("none"),
160 151 | |     }
161     | |_____^
162     |
163     = note: `-D match-ref-pats` implied by `-D warnings`
164 help: instead of prefixing all patterns with `&`, you can dereference the expression
165     |     match *tup { .. }
166
167 error: you don't need to add `&` to both the expression and the patterns
168    --> matches.rs:154:5
169     |
170 154 | /     match &w {
171 155 | |         &Some(v) => println!("{:?}", v),
172 156 | |         &None => println!("none"),
173 157 | |     }
174     | |_____^ help: try `match w { .. }`
175     |
176     = note: `-D match-ref-pats` implied by `-D warnings`
177
178 error: you don't need to add `&` to all patterns
179    --> matches.rs:165:5
180     |
181 165 | /     if let &None = a {
182 166 | |         println!("none");
183 167 | |     }
184     | |_____^
185     |
186     = note: `-D match-ref-pats` implied by `-D warnings`
187 help: instead of prefixing all patterns with `&`, you can dereference the expression
188     |     if let .. = *a { .. }
189
190 error: you don't need to add `&` to both the expression and the patterns
191    --> matches.rs:170:5
192     |
193 170 | /     if let &None = &b {
194 171 | |         println!("none");
195 172 | |     }
196     | |_____^ help: try `if let .. = b { .. }`
197     |
198     = note: `-D match-ref-pats` implied by `-D warnings`
199
200 error: some ranges overlap
201    --> matches.rs:179:9
202     |
203 179 |         0 ... 10 => println!("0 ... 10"),
204     |         ^^^^^^^^
205     |
206     = note: `-D match-overlapping-arm` implied by `-D warnings`
207 note: overlaps with this
208    --> matches.rs:180:9
209     |
210 180 |         0 ... 11 => println!("0 ... 11"),
211     |         ^^^^^^^^
212
213 error: some ranges overlap
214    --> matches.rs:185:9
215     |
216 185 |         0 ... 5 => println!("0 ... 5"),
217     |         ^^^^^^^
218     |
219     = note: `-D match-overlapping-arm` implied by `-D warnings`
220 note: overlaps with this
221    --> matches.rs:187:9
222     |
223 187 |         FOO ... 11 => println!("0 ... 11"),
224     |         ^^^^^^^^^^
225
226 error: some ranges overlap
227    --> matches.rs:193:9
228     |
229 193 |         0 ... 5 => println!("0 ... 5"),
230     |         ^^^^^^^
231     |
232     = note: `-D match-overlapping-arm` implied by `-D warnings`
233 note: overlaps with this
234    --> matches.rs:192:9
235     |
236 192 |         2 => println!("2"),
237     |         ^
238
239 error: some ranges overlap
240    --> matches.rs:199:9
241     |
242 199 |         0 ... 2 => println!("0 ... 2"),
243     |         ^^^^^^^
244     |
245     = note: `-D match-overlapping-arm` implied by `-D warnings`
246 note: overlaps with this
247    --> matches.rs:198:9
248     |
249 198 |         2 => println!("2"),
250     |         ^
251
252 error: some ranges overlap
253    --> matches.rs:222:9
254     |
255 222 |         0 .. 11 => println!("0 .. 11"),
256     |         ^^^^^^^
257     |
258     = note: `-D match-overlapping-arm` implied by `-D warnings`
259 note: overlaps with this
260    --> matches.rs:223:9
261     |
262 223 |         0 ... 11 => println!("0 ... 11"),
263     |         ^^^^^^^^
264
265 error: Err(_) will match all errors, maybe not a good idea
266    --> matches.rs:240:9
267     |
268 240 |         Err(_) => panic!("err")
269     |         ^^^^^^
270     |
271     = note: `-D match-wild-err-arm` implied by `-D warnings`
272     = note: to remove this warning, match each error seperately or use unreachable macro
273
274 error: Err(_) will match all errors, maybe not a good idea
275    --> matches.rs:246:9
276     |
277 246 |         Err(_) => {panic!()}
278     |         ^^^^^^
279     |
280     = note: `-D match-wild-err-arm` implied by `-D warnings`
281     = note: to remove this warning, match each error seperately or use unreachable macro
282
283 error: Err(_) will match all errors, maybe not a good idea
284    --> matches.rs:252:9
285     |
286 252 |         Err(_) => {panic!();}
287     |         ^^^^^^
288     |
289     = note: `-D match-wild-err-arm` implied by `-D warnings`
290     = note: to remove this warning, match each error seperately or use unreachable macro
291
292 error: aborting due to previous error(s)
293
294
295 To learn more, run the command again with --verbose.