rust-clippy/tests/ui/matches.stderr

379 lines
10 KiB
Text
Raw Normal View History

error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
--> $DIR/matches.rs:26:5
|
26 | / match ExprNode::Butterflies {
2017-02-08 13:58:07 +00:00
27 | |
28 | |
29 | |
30 | | ExprNode::ExprAddrOf => Some(&NODE),
31 | | _ => { let x = 5; None },
32 | | }
| |_____^ help: try this `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
|
note: lint level defined here
--> $DIR/matches.rs:7:9
|
7 | #![deny(single_match_else)]
| ^^^^^^^^^^^^^^^^^
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
--> $DIR/matches.rs:38:5
|
38 | / match x {
2017-02-08 13:58:07 +00:00
39 | |
40 | |
41 | |
42 | | Some(y) => { println!("{:?}", y); }
43 | | _ => ()
44 | | };
| |_____^ help: try this `if let Some(y) = x { println!("{:?}", y); }`
|
= note: #[deny(single_match)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/matches.rs:5:9
|
5 | #![deny(clippy)]
| ^^^^^^
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
--> $DIR/matches.rs:47:5
|
47 | / match z {
2017-02-08 13:58:07 +00:00
48 | |
49 | |
50 | |
51 | | (2...3, 7...9) => dummy(),
52 | | _ => {}
53 | | };
| |_____^ help: try this `if let (2...3, 7...9) = z { dummy() }`
|
= note: #[deny(single_match)] implied by #[deny(clippy)]
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
--> $DIR/matches.rs:72:5
|
72 | / match x {
2017-02-08 13:58:07 +00:00
73 | |
74 | |
75 | |
76 | | Some(y) => dummy(),
77 | | None => ()
78 | | };
| |_____^ help: try this `if let Some(y) = x { dummy() }`
|
= note: #[deny(single_match)] implied by #[deny(clippy)]
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
--> $DIR/matches.rs:80:5
|
80 | / match y {
2017-02-08 13:58:07 +00:00
81 | |
82 | |
83 | |
84 | | Ok(y) => dummy(),
85 | | Err(..) => ()
86 | | };
| |_____^ help: try this `if let Ok(y) = y { dummy() }`
|
= note: #[deny(single_match)] implied by #[deny(clippy)]
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
--> $DIR/matches.rs:90:5
|
90 | / match c {
2017-02-08 13:58:07 +00:00
91 | |
92 | |
93 | |
94 | | Cow::Borrowed(..) => dummy(),
95 | | Cow::Owned(..) => (),
96 | | };
| |_____^ help: try this `if let Cow::Borrowed(..) = c { dummy() }`
|
= note: #[deny(single_match)] implied by #[deny(clippy)]
error: you seem to be trying to match on a boolean expression
--> $DIR/matches.rs:114:5
|
114 | / match test {
2017-02-08 13:58:07 +00:00
115 | |
116 | |
117 | |
118 | | true => 0,
119 | | false => 42,
120 | | };
| |_____^ help: consider using an if/else expression `if test { 0 } else { 42 }`
|
= note: #[deny(match_bool)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/matches.rs:5:9
|
5 | #![deny(clippy)]
| ^^^^^^
error: you seem to be trying to match on a boolean expression
--> $DIR/matches.rs:123:5
|
123 | / match option == 1 {
2017-02-08 13:58:07 +00:00
124 | |
125 | |
126 | |
127 | | true => 1,
128 | | false => 0,
129 | | };
| |_____^ help: consider using an if/else expression `if option == 1 { 1 } else { 0 }`
|
= note: #[deny(match_bool)] implied by #[deny(clippy)]
error: you seem to be trying to match on a boolean expression
--> $DIR/matches.rs:131:5
|
131 | / match test {
2017-02-08 13:58:07 +00:00
132 | |
133 | |
134 | |
135 | | true => (),
136 | | false => { println!("Noooo!"); }
137 | | };
| |_____^ help: consider using an if/else expression `if !test { println!("Noooo!"); }`
|
= note: #[deny(match_bool)] implied by #[deny(clippy)]
error: you seem to be trying to match on a boolean expression
--> $DIR/matches.rs:139:5
|
139 | / match test {
2017-02-08 13:58:07 +00:00
140 | |
141 | |
142 | |
143 | | false => { println!("Noooo!"); }
144 | | _ => (),
145 | | };
| |_____^ help: consider using an if/else expression `if !test { println!("Noooo!"); }`
|
= note: #[deny(match_bool)] implied by #[deny(clippy)]
error: you seem to be trying to match on a boolean expression
--> $DIR/matches.rs:147:5
|
147 | / match test && test {
2017-02-08 13:58:07 +00:00
148 | |
149 | |
150 | |
... |
153 | | _ => (),
154 | | };
| |_____^ help: consider using an if/else expression `if !(test && test) { println!("Noooo!"); }`
|
= note: #[deny(match_bool)] implied by #[deny(clippy)]
error: equal expressions as operands to `&&`
--> $DIR/matches.rs:147:11
|
147 | match test && test {
| ^^^^^^^^^^^^
|
= note: #[deny(eq_op)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/matches.rs:5:9
|
5 | #![deny(clippy)]
| ^^^^^^
error: you seem to be trying to match on a boolean expression
--> $DIR/matches.rs:156:5
|
156 | / match test {
2017-02-08 13:58:07 +00:00
157 | |
158 | |
159 | |
160 | | false => { println!("Noooo!"); }
161 | | true => { println!("Yes!"); }
162 | | };
| |_____^ help: consider using an if/else expression `if test { println!("Yes!"); } else { println!("Noooo!"); }`
|
= note: #[deny(match_bool)] implied by #[deny(clippy)]
error: you don't need to add `&` to all patterns
--> $DIR/matches.rs:175:9
|
175 | / match v {
2017-02-08 13:58:07 +00:00
176 | |
177 | |
178 | |
179 | | &Some(v) => println!("{:?}", v),
180 | | &None => println!("none"),
181 | | }
| |_________^
|
= note: #[deny(match_ref_pats)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/matches.rs:5:9
|
5 | #![deny(clippy)]
| ^^^^^^
help: instead of prefixing all patterns with `&`, you can dereference the expression
| match *v { .. }
error: you don't need to add `&` to all patterns
--> $DIR/matches.rs:188:5
|
188 | / match tup {
2017-02-08 13:58:07 +00:00
189 | |
190 | |
191 | |
192 | | &(v, 1) => println!("{}", v),
193 | | _ => println!("none"),
194 | | }
| |_____^
|
= note: #[deny(match_ref_pats)] implied by #[deny(clippy)]
help: instead of prefixing all patterns with `&`, you can dereference the expression
| match *tup { .. }
error: you don't need to add `&` to both the expression and the patterns
--> $DIR/matches.rs:197:5
|
197 | / match &w {
2017-02-08 13:58:07 +00:00
198 | |
199 | |
200 | |
201 | | &Some(v) => println!("{:?}", v),
202 | | &None => println!("none"),
203 | | }
| |_____^ help: try `match w { .. }`
|
= note: #[deny(match_ref_pats)] implied by #[deny(clippy)]
error: you don't need to add `&` to all patterns
--> $DIR/matches.rs:211:5
|
211 | / if let &None = a {
2017-02-08 13:58:07 +00:00
212 | |
213 | |
214 | |
215 | | println!("none");
216 | | }
| |_____^
|
= note: #[deny(match_ref_pats)] implied by #[deny(clippy)]
help: instead of prefixing all patterns with `&`, you can dereference the expression
| if let .. = *a { .. }
error: you don't need to add `&` to both the expression and the patterns
--> $DIR/matches.rs:219:5
|
219 | / if let &None = &b {
2017-02-08 13:58:07 +00:00
220 | |
221 | |
222 | |
223 | | println!("none");
224 | | }
| |_____^ help: try `if let .. = b { .. }`
|
= note: #[deny(match_ref_pats)] implied by #[deny(clippy)]
error: some ranges overlap
--> $DIR/matches.rs:231:9
|
2017-02-08 13:58:07 +00:00
231 | 0 ... 10 => println!("0 ... 10"),
| ^^^^^^^^
|
= note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/matches.rs:5:9
|
5 | #![deny(clippy)]
| ^^^^^^
note: overlaps with this
--> $DIR/matches.rs:232:9
|
2017-02-08 13:58:07 +00:00
232 | 0 ... 11 => println!("0 ... 11"),
| ^^^^^^^^
error: some ranges overlap
--> $DIR/matches.rs:237:9
|
2017-02-08 13:58:07 +00:00
237 | 0 ... 5 => println!("0 ... 5"),
| ^^^^^^^
|
= note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
note: overlaps with this
--> $DIR/matches.rs:239:9
|
2017-02-08 13:58:07 +00:00
239 | FOO ... 11 => println!("0 ... 11"),
| ^^^^^^^^^^
error: some ranges overlap
--> $DIR/matches.rs:245:9
|
2017-02-08 13:58:07 +00:00
245 | 0 ... 5 => println!("0 ... 5"),
| ^^^^^^^
|
= note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
note: overlaps with this
--> $DIR/matches.rs:244:9
|
2017-02-08 13:58:07 +00:00
244 | 2 => println!("2"),
| ^
error: some ranges overlap
--> $DIR/matches.rs:251:9
|
2017-02-08 13:58:07 +00:00
251 | 0 ... 2 => println!("0 ... 2"),
| ^^^^^^^
|
= note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
note: overlaps with this
--> $DIR/matches.rs:250:9
|
2017-02-08 13:58:07 +00:00
250 | 2 => println!("2"),
| ^
error: some ranges overlap
--> $DIR/matches.rs:274:9
|
2017-02-08 13:58:07 +00:00
274 | 0 .. 11 => println!("0 .. 11"),
| ^^^^^^^
|
= note: #[deny(match_overlapping_arm)] implied by #[deny(clippy)]
note: overlaps with this
--> $DIR/matches.rs:275:9
|
2017-02-08 13:58:07 +00:00
275 | 0 ... 11 => println!("0 ... 11"),
| ^^^^^^^^
2017-02-11 06:57:50 +00:00
error: Err(_) will match all errors, maybe not a good idea
--> $DIR/matches.rs:292:9
|
2017-02-11 13:42:42 +00:00
292 | Err(_) => panic!("err")
2017-02-11 06:57:50 +00:00
| ^^^^^^
|
= note: #[deny(match_wild_err_arm)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/matches.rs:5:9
|
5 | #![deny(clippy)]
| ^^^^^^
= note: to remove this warning, match each error seperately or use unreachable macro
error: Err(_) will match all errors, maybe not a good idea
--> $DIR/matches.rs:298:9
|
2017-02-11 13:42:42 +00:00
298 | Err(_) => {panic!()}
2017-02-11 06:57:50 +00:00
| ^^^^^^
|
= note: #[deny(match_wild_err_arm)] implied by #[deny(clippy)]
= note: to remove this warning, match each error seperately or use unreachable macro
2017-02-11 13:42:42 +00:00
error: Err(_) will match all errors, maybe not a good idea
--> $DIR/matches.rs:304:9
|
304 | Err(_) => {panic!();}
| ^^^^^^
|
= note: #[deny(match_wild_err_arm)] implied by #[deny(clippy)]
= note: to remove this warning, match each error seperately or use unreachable macro
error: aborting due to 26 previous errors