]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/redundant_pattern_matching.stderr
Auto merge of #74772 - JohnTitor:add-tests, r=lcnr
[rust.git] / src / tools / clippy / tests / ui / redundant_pattern_matching.stderr
1 error: redundant pattern matching, consider using `is_ok()`
2   --> $DIR/redundant_pattern_matching.rs:14:12
3    |
4 LL |     if let Ok(_) = Ok::<i32, i32>(42) {}
5    |     -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
6    |
7    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
9 error: redundant pattern matching, consider using `is_err()`
10   --> $DIR/redundant_pattern_matching.rs:16:12
11    |
12 LL |     if let Err(_) = Err::<i32, i32>(42) {}
13    |     -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
14
15 error: redundant pattern matching, consider using `is_none()`
16   --> $DIR/redundant_pattern_matching.rs:18:12
17    |
18 LL |     if let None = None::<()> {}
19    |     -------^^^^------------- help: try this: `if None::<()>.is_none()`
20
21 error: redundant pattern matching, consider using `is_some()`
22   --> $DIR/redundant_pattern_matching.rs:20:12
23    |
24 LL |     if let Some(_) = Some(42) {}
25    |     -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
26
27 error: redundant pattern matching, consider using `is_some()`
28   --> $DIR/redundant_pattern_matching.rs:22:12
29    |
30 LL |     if let Some(_) = Some(42) {
31    |     -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
32
33 error: redundant pattern matching, consider using `is_some()`
34   --> $DIR/redundant_pattern_matching.rs:28:15
35    |
36 LL |     while let Some(_) = Some(42) {}
37    |     ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
38
39 error: redundant pattern matching, consider using `is_none()`
40   --> $DIR/redundant_pattern_matching.rs:30:15
41    |
42 LL |     while let None = Some(42) {}
43    |     ----------^^^^----------- help: try this: `while Some(42).is_none()`
44
45 error: redundant pattern matching, consider using `is_none()`
46   --> $DIR/redundant_pattern_matching.rs:32:15
47    |
48 LL |     while let None = None::<()> {}
49    |     ----------^^^^------------- help: try this: `while None::<()>.is_none()`
50
51 error: redundant pattern matching, consider using `is_ok()`
52   --> $DIR/redundant_pattern_matching.rs:34:15
53    |
54 LL |     while let Ok(_) = Ok::<i32, i32>(10) {}
55    |     ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
56
57 error: redundant pattern matching, consider using `is_err()`
58   --> $DIR/redundant_pattern_matching.rs:36:15
59    |
60 LL |     while let Err(_) = Ok::<i32, i32>(10) {}
61    |     ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
62
63 error: redundant pattern matching, consider using `is_some()`
64   --> $DIR/redundant_pattern_matching.rs:39:15
65    |
66 LL |     while let Some(_) = v.pop() {
67    |     ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
68
69 error: redundant pattern matching, consider using `is_ok()`
70   --> $DIR/redundant_pattern_matching.rs:55:5
71    |
72 LL | /     match Ok::<i32, i32>(42) {
73 LL | |         Ok(_) => true,
74 LL | |         Err(_) => false,
75 LL | |     };
76    | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
77
78 error: redundant pattern matching, consider using `is_err()`
79   --> $DIR/redundant_pattern_matching.rs:60:5
80    |
81 LL | /     match Ok::<i32, i32>(42) {
82 LL | |         Ok(_) => false,
83 LL | |         Err(_) => true,
84 LL | |     };
85    | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
86
87 error: redundant pattern matching, consider using `is_err()`
88   --> $DIR/redundant_pattern_matching.rs:65:5
89    |
90 LL | /     match Err::<i32, i32>(42) {
91 LL | |         Ok(_) => false,
92 LL | |         Err(_) => true,
93 LL | |     };
94    | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
95
96 error: redundant pattern matching, consider using `is_ok()`
97   --> $DIR/redundant_pattern_matching.rs:70:5
98    |
99 LL | /     match Err::<i32, i32>(42) {
100 LL | |         Ok(_) => true,
101 LL | |         Err(_) => false,
102 LL | |     };
103    | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
104
105 error: redundant pattern matching, consider using `is_some()`
106   --> $DIR/redundant_pattern_matching.rs:75:5
107    |
108 LL | /     match Some(42) {
109 LL | |         Some(_) => true,
110 LL | |         None => false,
111 LL | |     };
112    | |_____^ help: try this: `Some(42).is_some()`
113
114 error: redundant pattern matching, consider using `is_none()`
115   --> $DIR/redundant_pattern_matching.rs:80:5
116    |
117 LL | /     match None::<()> {
118 LL | |         Some(_) => false,
119 LL | |         None => true,
120 LL | |     };
121    | |_____^ help: try this: `None::<()>.is_none()`
122
123 error: redundant pattern matching, consider using `is_none()`
124   --> $DIR/redundant_pattern_matching.rs:85:13
125    |
126 LL |       let _ = match None::<()> {
127    |  _____________^
128 LL | |         Some(_) => false,
129 LL | |         None => true,
130 LL | |     };
131    | |_____^ help: try this: `None::<()>.is_none()`
132
133 error: redundant pattern matching, consider using `is_ok()`
134   --> $DIR/redundant_pattern_matching.rs:90:20
135    |
136 LL |     let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
137    |             -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
138
139 error: redundant pattern matching, consider using `is_some()`
140   --> $DIR/redundant_pattern_matching.rs:93:20
141    |
142 LL |     let x = if let Some(_) = opt { true } else { false };
143    |             -------^^^^^^^------ help: try this: `if opt.is_some()`
144
145 error: redundant pattern matching, consider using `is_some()`
146   --> $DIR/redundant_pattern_matching.rs:99:20
147    |
148 LL |     let _ = if let Some(_) = gen_opt() {
149    |             -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
150
151 error: redundant pattern matching, consider using `is_none()`
152   --> $DIR/redundant_pattern_matching.rs:101:19
153    |
154 LL |     } else if let None = gen_opt() {
155    |            -------^^^^------------ help: try this: `if gen_opt().is_none()`
156
157 error: redundant pattern matching, consider using `is_ok()`
158   --> $DIR/redundant_pattern_matching.rs:103:19
159    |
160 LL |     } else if let Ok(_) = gen_res() {
161    |            -------^^^^^------------ help: try this: `if gen_res().is_ok()`
162
163 error: redundant pattern matching, consider using `is_err()`
164   --> $DIR/redundant_pattern_matching.rs:105:19
165    |
166 LL |     } else if let Err(_) = gen_res() {
167    |            -------^^^^^^------------ help: try this: `if gen_res().is_err()`
168
169 error: redundant pattern matching, consider using `is_some()`
170   --> $DIR/redundant_pattern_matching.rs:138:19
171    |
172 LL |         while let Some(_) = r#try!(result_opt()) {}
173    |         ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
174
175 error: redundant pattern matching, consider using `is_some()`
176   --> $DIR/redundant_pattern_matching.rs:139:16
177    |
178 LL |         if let Some(_) = r#try!(result_opt()) {}
179    |         -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
180
181 error: redundant pattern matching, consider using `is_some()`
182   --> $DIR/redundant_pattern_matching.rs:145:12
183    |
184 LL |     if let Some(_) = m!() {}
185    |     -------^^^^^^^------- help: try this: `if m!().is_some()`
186
187 error: redundant pattern matching, consider using `is_some()`
188   --> $DIR/redundant_pattern_matching.rs:146:15
189    |
190 LL |     while let Some(_) = m!() {}
191    |     ----------^^^^^^^------- help: try this: `while m!().is_some()`
192
193 error: aborting due to 28 previous errors
194