]> git.lizzy.rs Git - rust.git/blob - tests/ui/unneeded_wildcard_pattern.fixed
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / unneeded_wildcard_pattern.fixed
1 // run-rustfix
2 #![feature(stmt_expr_attributes)]
3 #![deny(clippy::unneeded_wildcard_pattern)]
4
5 fn main() {
6     let t = (0, 1, 2, 3);
7
8     if let (0, ..) = t {};
9     if let (0, ..) = t {};
10     if let (.., 0) = t {};
11     if let (.., 0) = t {};
12     if let (0, ..) = t {};
13     if let (0, ..) = t {};
14     if let (_, 0, ..) = t {};
15     if let (.., 0, _) = t {};
16     if let (0, _, _, _) = t {};
17     if let (0, ..) = t {};
18     if let (.., 0) = t {};
19
20     #[rustfmt::skip]
21     {
22         if let (0, ..,) = t {};
23     }
24
25     struct S(usize, usize, usize, usize);
26
27     let s = S(0, 1, 2, 3);
28
29     if let S(0, ..) = s {};
30     if let S(0, ..) = s {};
31     if let S(.., 0) = s {};
32     if let S(.., 0) = s {};
33     if let S(0, ..) = s {};
34     if let S(0, ..) = s {};
35     if let S(_, 0, ..) = s {};
36     if let S(.., 0, _) = s {};
37     if let S(0, _, _, _) = s {};
38     if let S(0, ..) = s {};
39     if let S(.., 0) = s {};
40
41     #[rustfmt::skip]
42     {
43         if let S(0, ..,) = s {};
44     }
45 }