Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1dd9974

Browse files
committedMay 20, 2025
temp
1 parent 47d2fd6 commit 1dd9974

File tree

2 files changed

+61
-61
lines changed

2 files changed

+61
-61
lines changed
 

‎src/tools/clippy/tests/ui/redundant_guards.stderr

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: redundant guard
2-
--> tests/ui/redundant_guards.rs:22:14
2+
--> tests/ui/redundant_guards.rs:21:14
33
|
44
LL | x if x == 0.0 => todo!(),
55
| ^^^^^^^^
@@ -13,7 +13,7 @@ LL + 0.0 => todo!(),
1313
|
1414

1515
error: redundant guard
16-
--> tests/ui/redundant_guards.rs:29:14
16+
--> tests/ui/redundant_guards.rs:28:14
1717
|
1818
LL | x if x == FloatWrapper(0.0) => todo!(),
1919
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL + FloatWrapper(0.0) => todo!(),
2525
|
2626

2727
error: redundant guard
28-
--> tests/ui/redundant_guards.rs:45:20
28+
--> tests/ui/redundant_guards.rs:44:20
2929
|
3030
LL | C(x, y) if let 1 = y => ..,
3131
| ^^^^^^^^^
@@ -37,7 +37,7 @@ LL + C(x, 1) => ..,
3737
|
3838

3939
error: redundant guard
40-
--> tests/ui/redundant_guards.rs:52:20
40+
--> tests/ui/redundant_guards.rs:51:20
4141
|
4242
LL | Some(x) if matches!(x, Some(1) if true) => ..,
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL + Some(Some(1)) if true => ..,
4949
|
5050

5151
error: redundant guard
52-
--> tests/ui/redundant_guards.rs:54:20
52+
--> tests/ui/redundant_guards.rs:53:20
5353
|
5454
LL | Some(x) if matches!(x, Some(1)) => {
5555
| ^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL + Some(Some(1)) => {
6161
|
6262

6363
error: redundant guard
64-
--> tests/ui/redundant_guards.rs:59:20
64+
--> tests/ui/redundant_guards.rs:58:20
6565
|
6666
LL | Some(x) if let Some(1) = x => ..,
6767
| ^^^^^^^^^^^^^^^
@@ -73,7 +73,7 @@ LL + Some(Some(1)) => ..,
7373
|
7474

7575
error: redundant guard
76-
--> tests/ui/redundant_guards.rs:61:20
76+
--> tests/ui/redundant_guards.rs:60:20
7777
|
7878
LL | Some(x) if x == Some(2) => ..,
7979
| ^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL + Some(Some(2)) => ..,
8585
|
8686

8787
error: redundant guard
88-
--> tests/ui/redundant_guards.rs:63:20
88+
--> tests/ui/redundant_guards.rs:62:20
8989
|
9090
LL | Some(x) if Some(2) == x => ..,
9191
| ^^^^^^^^^^^^
@@ -97,7 +97,7 @@ LL + Some(Some(2)) => ..,
9797
|
9898

9999
error: redundant guard
100-
--> tests/ui/redundant_guards.rs:89:20
100+
--> tests/ui/redundant_guards.rs:88:20
101101
|
102102
LL | B { e } if matches!(e, Some(A(2))) => ..,
103103
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -109,7 +109,7 @@ LL + B { e: Some(A(2)) } => ..,
109109
|
110110

111111
error: redundant guard
112-
--> tests/ui/redundant_guards.rs:127:20
112+
--> tests/ui/redundant_guards.rs:126:20
113113
|
114114
LL | E::A(y) if y == "not from an or pattern" => {},
115115
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -121,7 +121,7 @@ LL + E::A("not from an or pattern") => {},
121121
|
122122

123123
error: redundant guard
124-
--> tests/ui/redundant_guards.rs:135:14
124+
--> tests/ui/redundant_guards.rs:134:14
125125
|
126126
LL | x if matches!(x, Some(0)) => ..,
127127
| ^^^^^^^^^^^^^^^^^^^^
@@ -133,7 +133,7 @@ LL + Some(0) => ..,
133133
|
134134

135135
error: redundant guard
136-
--> tests/ui/redundant_guards.rs:143:14
136+
--> tests/ui/redundant_guards.rs:142:14
137137
|
138138
LL | i if i == -1 => {},
139139
| ^^^^^^^
@@ -145,7 +145,7 @@ LL + -1 => {},
145145
|
146146

147147
error: redundant guard
148-
--> tests/ui/redundant_guards.rs:145:14
148+
--> tests/ui/redundant_guards.rs:144:14
149149
|
150150
LL | i if i == 1 => {},
151151
| ^^^^^^
@@ -157,7 +157,7 @@ LL + 1 => {},
157157
|
158158

159159
error: redundant guard
160-
--> tests/ui/redundant_guards.rs:208:28
160+
--> tests/ui/redundant_guards.rs:207:28
161161
|
162162
LL | Some(ref x) if x == &1 => {},
163163
| ^^^^^^^
@@ -169,7 +169,7 @@ LL + Some(1) => {},
169169
|
170170

171171
error: redundant guard
172-
--> tests/ui/redundant_guards.rs:210:28
172+
--> tests/ui/redundant_guards.rs:209:28
173173
|
174174
LL | Some(ref x) if &1 == x => {},
175175
| ^^^^^^^
@@ -181,7 +181,7 @@ LL + Some(1) => {},
181181
|
182182

183183
error: redundant guard
184-
--> tests/ui/redundant_guards.rs:212:28
184+
--> tests/ui/redundant_guards.rs:211:28
185185
|
186186
LL | Some(ref x) if let &2 = x => {},
187187
| ^^^^^^^^^^
@@ -193,7 +193,7 @@ LL + Some(2) => {},
193193
|
194194

195195
error: redundant guard
196-
--> tests/ui/redundant_guards.rs:214:28
196+
--> tests/ui/redundant_guards.rs:213:28
197197
|
198198
LL | Some(ref x) if matches!(x, &3) => {},
199199
| ^^^^^^^^^^^^^^^
@@ -205,7 +205,7 @@ LL + Some(3) => {},
205205
|
206206

207207
error: redundant guard
208-
--> tests/ui/redundant_guards.rs:235:32
208+
--> tests/ui/redundant_guards.rs:234:32
209209
|
210210
LL | B { ref c, .. } if c == &1 => {},
211211
| ^^^^^^^
@@ -217,7 +217,7 @@ LL + B { c: 1, .. } => {},
217217
|
218218

219219
error: redundant guard
220-
--> tests/ui/redundant_guards.rs:237:32
220+
--> tests/ui/redundant_guards.rs:236:32
221221
|
222222
LL | B { ref c, .. } if &1 == c => {},
223223
| ^^^^^^^
@@ -229,7 +229,7 @@ LL + B { c: 1, .. } => {},
229229
|
230230

231231
error: redundant guard
232-
--> tests/ui/redundant_guards.rs:239:32
232+
--> tests/ui/redundant_guards.rs:238:32
233233
|
234234
LL | B { ref c, .. } if let &1 = c => {},
235235
| ^^^^^^^^^^
@@ -241,7 +241,7 @@ LL + B { c: 1, .. } => {},
241241
|
242242

243243
error: redundant guard
244-
--> tests/ui/redundant_guards.rs:241:32
244+
--> tests/ui/redundant_guards.rs:240:32
245245
|
246246
LL | B { ref c, .. } if matches!(c, &1) => {},
247247
| ^^^^^^^^^^^^^^^
@@ -253,7 +253,7 @@ LL + B { c: 1, .. } => {},
253253
|
254254

255255
error: redundant guard
256-
--> tests/ui/redundant_guards.rs:252:26
256+
--> tests/ui/redundant_guards.rs:251:26
257257
|
258258
LL | Some(Some(x)) if x.is_empty() => {},
259259
| ^^^^^^^^^^^^
@@ -265,7 +265,7 @@ LL + Some(Some("")) => {},
265265
|
266266

267267
error: redundant guard
268-
--> tests/ui/redundant_guards.rs:264:26
268+
--> tests/ui/redundant_guards.rs:263:26
269269
|
270270
LL | Some(Some(x)) if x.is_empty() => {},
271271
| ^^^^^^^^^^^^
@@ -277,7 +277,7 @@ LL + Some(Some([])) => {},
277277
|
278278

279279
error: redundant guard
280-
--> tests/ui/redundant_guards.rs:270:26
280+
--> tests/ui/redundant_guards.rs:269:26
281281
|
282282
LL | Some(Some(x)) if x.is_empty() => {},
283283
| ^^^^^^^^^^^^
@@ -289,7 +289,7 @@ LL + Some(Some([])) => {},
289289
|
290290

291291
error: redundant guard
292-
--> tests/ui/redundant_guards.rs:282:26
292+
--> tests/ui/redundant_guards.rs:281:26
293293
|
294294
LL | Some(Some(x)) if x.starts_with(&[]) => {},
295295
| ^^^^^^^^^^^^^^^^^^
@@ -301,7 +301,7 @@ LL + Some(Some([..])) => {},
301301
|
302302

303303
error: redundant guard
304-
--> tests/ui/redundant_guards.rs:288:26
304+
--> tests/ui/redundant_guards.rs:287:26
305305
|
306306
LL | Some(Some(x)) if x.starts_with(&[1]) => {},
307307
| ^^^^^^^^^^^^^^^^^^^
@@ -313,7 +313,7 @@ LL + Some(Some([1, ..])) => {},
313313
|
314314

315315
error: redundant guard
316-
--> tests/ui/redundant_guards.rs:294:26
316+
--> tests/ui/redundant_guards.rs:293:26
317317
|
318318
LL | Some(Some(x)) if x.starts_with(&[1, 2]) => {},
319319
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -325,7 +325,7 @@ LL + Some(Some([1, 2, ..])) => {},
325325
|
326326

327327
error: redundant guard
328-
--> tests/ui/redundant_guards.rs:300:26
328+
--> tests/ui/redundant_guards.rs:299:26
329329
|
330330
LL | Some(Some(x)) if x.ends_with(&[1, 2]) => {},
331331
| ^^^^^^^^^^^^^^^^^^^^
@@ -337,7 +337,7 @@ LL + Some(Some([.., 1, 2])) => {},
337337
|
338338

339339
error: redundant guard
340-
--> tests/ui/redundant_guards.rs:323:18
340+
--> tests/ui/redundant_guards.rs:322:18
341341
|
342342
LL | y if y.is_empty() => {},
343343
| ^^^^^^^^^^^^
@@ -349,7 +349,7 @@ LL + "" => {},
349349
|
350350

351351
error: redundant guard
352-
--> tests/ui/redundant_guards.rs:342:22
352+
--> tests/ui/redundant_guards.rs:341:22
353353
|
354354
LL | y if y.is_empty() => {},
355355
| ^^^^^^^^^^^^

‎src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: redundant pattern matching, consider using `is_none()`
2-
--> tests/ui/redundant_pattern_matching_option.rs:12:5
2+
--> tests/ui/redundant_pattern_matching_option.rs:11:5
33
|
44
LL | matches!(maybe_some, None if !boolean)
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `maybe_some.is_none() && (!boolean)`
@@ -8,55 +8,55 @@ LL | matches!(maybe_some, None if !boolean)
88
= help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]`
99

1010
error: redundant pattern matching, consider using `is_none()`
11-
--> tests/ui/redundant_pattern_matching_option.rs:17:13
11+
--> tests/ui/redundant_pattern_matching_option.rs:16:13
1212
|
1313
LL | let _ = matches!(maybe_some, None if boolean || boolean2); // guard needs parentheses
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `maybe_some.is_none() && (boolean || boolean2)`
1515

1616
error: redundant pattern matching, consider using `is_none()`
17-
--> tests/ui/redundant_pattern_matching_option.rs:33:12
17+
--> tests/ui/redundant_pattern_matching_option.rs:32:12
1818
|
1919
LL | if let None = None::<()> {}
2020
| -------^^^^------------- help: try: `if None::<()>.is_none()`
2121

2222
error: redundant pattern matching, consider using `is_some()`
23-
--> tests/ui/redundant_pattern_matching_option.rs:36:12
23+
--> tests/ui/redundant_pattern_matching_option.rs:35:12
2424
|
2525
LL | if let Some(_) = Some(42) {}
2626
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
2727

2828
error: redundant pattern matching, consider using `is_some()`
29-
--> tests/ui/redundant_pattern_matching_option.rs:39:12
29+
--> tests/ui/redundant_pattern_matching_option.rs:38:12
3030
|
3131
LL | if let Some(_) = Some(42) {
3232
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
3333

3434
error: redundant pattern matching, consider using `is_some()`
35-
--> tests/ui/redundant_pattern_matching_option.rs:46:15
35+
--> tests/ui/redundant_pattern_matching_option.rs:45:15
3636
|
3737
LL | while let Some(_) = Some(42) {}
3838
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
3939

4040
error: redundant pattern matching, consider using `is_none()`
41-
--> tests/ui/redundant_pattern_matching_option.rs:49:15
41+
--> tests/ui/redundant_pattern_matching_option.rs:48:15
4242
|
4343
LL | while let None = Some(42) {}
4444
| ----------^^^^----------- help: try: `while Some(42).is_none()`
4545

4646
error: redundant pattern matching, consider using `is_none()`
47-
--> tests/ui/redundant_pattern_matching_option.rs:52:15
47+
--> tests/ui/redundant_pattern_matching_option.rs:51:15
4848
|
4949
LL | while let None = None::<()> {}
5050
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
5151

5252
error: redundant pattern matching, consider using `is_some()`
53-
--> tests/ui/redundant_pattern_matching_option.rs:56:15
53+
--> tests/ui/redundant_pattern_matching_option.rs:55:15
5454
|
5555
LL | while let Some(_) = v.pop() {
5656
| ----------^^^^^^^---------- help: try: `while v.pop().is_some()`
5757

5858
error: redundant pattern matching, consider using `is_some()`
59-
--> tests/ui/redundant_pattern_matching_option.rs:65:5
59+
--> tests/ui/redundant_pattern_matching_option.rs:64:5
6060
|
6161
LL | / match Some(42) {
6262
LL | |
@@ -66,7 +66,7 @@ LL | | };
6666
| |_____^ help: try: `Some(42).is_some()`
6767

6868
error: redundant pattern matching, consider using `is_none()`
69-
--> tests/ui/redundant_pattern_matching_option.rs:71:5
69+
--> tests/ui/redundant_pattern_matching_option.rs:70:5
7070
|
7171
LL | / match None::<()> {
7272
LL | |
@@ -76,7 +76,7 @@ LL | | };
7676
| |_____^ help: try: `None::<()>.is_none()`
7777

7878
error: redundant pattern matching, consider using `is_none()`
79-
--> tests/ui/redundant_pattern_matching_option.rs:77:13
79+
--> tests/ui/redundant_pattern_matching_option.rs:76:13
8080
|
8181
LL | let _ = match None::<()> {
8282
| _____________^
@@ -87,55 +87,55 @@ LL | | };
8787
| |_____^ help: try: `None::<()>.is_none()`
8888

8989
error: redundant pattern matching, consider using `is_some()`
90-
--> tests/ui/redundant_pattern_matching_option.rs:84:20
90+
--> tests/ui/redundant_pattern_matching_option.rs:83:20
9191
|
9292
LL | let _ = if let Some(_) = opt { true } else { false };
9393
| -------^^^^^^^------ help: try: `if opt.is_some()`
9494

9595
error: redundant pattern matching, consider using `is_some()`
96-
--> tests/ui/redundant_pattern_matching_option.rs:91:20
96+
--> tests/ui/redundant_pattern_matching_option.rs:90:20
9797
|
9898
LL | let _ = if let Some(_) = gen_opt() {
9999
| -------^^^^^^^------------ help: try: `if gen_opt().is_some()`
100100

101101
error: redundant pattern matching, consider using `is_none()`
102-
--> tests/ui/redundant_pattern_matching_option.rs:94:19
102+
--> tests/ui/redundant_pattern_matching_option.rs:93:19
103103
|
104104
LL | } else if let None = gen_opt() {
105105
| -------^^^^------------ help: try: `if gen_opt().is_none()`
106106

107107
error: redundant pattern matching, consider using `is_some()`
108-
--> tests/ui/redundant_pattern_matching_option.rs:101:12
108+
--> tests/ui/redundant_pattern_matching_option.rs:100:12
109109
|
110110
LL | if let Some(..) = gen_opt() {}
111111
| -------^^^^^^^^------------ help: try: `if gen_opt().is_some()`
112112

113113
error: redundant pattern matching, consider using `is_some()`
114-
--> tests/ui/redundant_pattern_matching_option.rs:117:12
114+
--> tests/ui/redundant_pattern_matching_option.rs:116:12
115115
|
116116
LL | if let Some(_) = Some(42) {}
117117
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
118118

119119
error: redundant pattern matching, consider using `is_none()`
120-
--> tests/ui/redundant_pattern_matching_option.rs:120:12
120+
--> tests/ui/redundant_pattern_matching_option.rs:119:12
121121
|
122122
LL | if let None = None::<()> {}
123123
| -------^^^^------------- help: try: `if None::<()>.is_none()`
124124

125125
error: redundant pattern matching, consider using `is_some()`
126-
--> tests/ui/redundant_pattern_matching_option.rs:123:15
126+
--> tests/ui/redundant_pattern_matching_option.rs:122:15
127127
|
128128
LL | while let Some(_) = Some(42) {}
129129
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
130130

131131
error: redundant pattern matching, consider using `is_none()`
132-
--> tests/ui/redundant_pattern_matching_option.rs:126:15
132+
--> tests/ui/redundant_pattern_matching_option.rs:125:15
133133
|
134134
LL | while let None = None::<()> {}
135135
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
136136

137137
error: redundant pattern matching, consider using `is_some()`
138-
--> tests/ui/redundant_pattern_matching_option.rs:129:5
138+
--> tests/ui/redundant_pattern_matching_option.rs:128:5
139139
|
140140
LL | / match Some(42) {
141141
LL | |
@@ -145,7 +145,7 @@ LL | | };
145145
| |_____^ help: try: `Some(42).is_some()`
146146

147147
error: redundant pattern matching, consider using `is_none()`
148-
--> tests/ui/redundant_pattern_matching_option.rs:135:5
148+
--> tests/ui/redundant_pattern_matching_option.rs:134:5
149149
|
150150
LL | / match None::<()> {
151151
LL | |
@@ -155,19 +155,19 @@ LL | | };
155155
| |_____^ help: try: `None::<()>.is_none()`
156156

157157
error: redundant pattern matching, consider using `is_none()`
158-
--> tests/ui/redundant_pattern_matching_option.rs:144:12
158+
--> tests/ui/redundant_pattern_matching_option.rs:143:12
159159
|
160160
LL | if let None = *(&None::<()>) {}
161161
| -------^^^^----------------- help: try: `if (&None::<()>).is_none()`
162162

163163
error: redundant pattern matching, consider using `is_none()`
164-
--> tests/ui/redundant_pattern_matching_option.rs:146:12
164+
--> tests/ui/redundant_pattern_matching_option.rs:145:12
165165
|
166166
LL | if let None = *&None::<()> {}
167167
| -------^^^^--------------- help: try: `if (&None::<()>).is_none()`
168168

169169
error: redundant pattern matching, consider using `is_some()`
170-
--> tests/ui/redundant_pattern_matching_option.rs:153:5
170+
--> tests/ui/redundant_pattern_matching_option.rs:152:5
171171
|
172172
LL | / match x {
173173
LL | |
@@ -177,7 +177,7 @@ LL | | };
177177
| |_____^ help: try: `x.is_some()`
178178

179179
error: redundant pattern matching, consider using `is_none()`
180-
--> tests/ui/redundant_pattern_matching_option.rs:159:5
180+
--> tests/ui/redundant_pattern_matching_option.rs:158:5
181181
|
182182
LL | / match x {
183183
LL | |
@@ -187,7 +187,7 @@ LL | | };
187187
| |_____^ help: try: `x.is_none()`
188188

189189
error: redundant pattern matching, consider using `is_none()`
190-
--> tests/ui/redundant_pattern_matching_option.rs:165:5
190+
--> tests/ui/redundant_pattern_matching_option.rs:164:5
191191
|
192192
LL | / match x {
193193
LL | |
@@ -197,7 +197,7 @@ LL | | };
197197
| |_____^ help: try: `x.is_none()`
198198

199199
error: redundant pattern matching, consider using `is_some()`
200-
--> tests/ui/redundant_pattern_matching_option.rs:171:5
200+
--> tests/ui/redundant_pattern_matching_option.rs:170:5
201201
|
202202
LL | / match x {
203203
LL | |
@@ -207,19 +207,19 @@ LL | | };
207207
| |_____^ help: try: `x.is_some()`
208208

209209
error: redundant pattern matching, consider using `is_some()`
210-
--> tests/ui/redundant_pattern_matching_option.rs:187:13
210+
--> tests/ui/redundant_pattern_matching_option.rs:186:13
211211
|
212212
LL | let _ = matches!(x, Some(_));
213213
| ^^^^^^^^^^^^^^^^^^^^ help: try: `x.is_some()`
214214

215215
error: redundant pattern matching, consider using `is_none()`
216-
--> tests/ui/redundant_pattern_matching_option.rs:190:13
216+
--> tests/ui/redundant_pattern_matching_option.rs:189:13
217217
|
218218
LL | let _ = matches!(x, None);
219219
| ^^^^^^^^^^^^^^^^^ help: try: `x.is_none()`
220220

221221
error: redundant pattern matching, consider using `is_none()`
222-
--> tests/ui/redundant_pattern_matching_option.rs:201:17
222+
--> tests/ui/redundant_pattern_matching_option.rs:200:17
223223
|
224224
LL | let _ = matches!(*p, None);
225225
| ^^^^^^^^^^^^^^^^^^ help: try: `(*p).is_none()`

0 commit comments

Comments
 (0)
Please sign in to comment.