]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_same_arms2.stderr
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / match_same_arms2.stderr
1 error: this `match` has identical arm bodies
2   --> $DIR/match_same_arms2.rs:20:14
3    |
4 LL |           _ => {
5    |  ______________^
6 LL | |             //~ ERROR match arms have same body
7 LL | |             foo();
8 LL | |             let mut a = 42 + [23].len() as i32;
9 ...  |
10 LL | |             a
11 LL | |         },
12    | |_________^
13    |
14    = note: `-D clippy::match-same-arms` implied by `-D warnings`
15 note: same as this
16   --> $DIR/match_same_arms2.rs:11:15
17    |
18 LL |           42 => {
19    |  _______________^
20 LL | |             foo();
21 LL | |             let mut a = 42 + [23].len() as i32;
22 LL | |             if true {
23 ...  |
24 LL | |             a
25 LL | |         },
26    | |_________^
27 note: `42` has the same arm body as the `_` wildcard, consider removing it
28   --> $DIR/match_same_arms2.rs:11:15
29    |
30 LL |           42 => {
31    |  _______________^
32 LL | |             foo();
33 LL | |             let mut a = 42 + [23].len() as i32;
34 LL | |             if true {
35 ...  |
36 LL | |             a
37 LL | |         },
38    | |_________^
39
40 error: this `match` has identical arm bodies
41   --> $DIR/match_same_arms2.rs:34:15
42    |
43 LL |         51 => foo(), //~ ERROR match arms have same body
44    |               ^^^^^
45    |
46 note: same as this
47   --> $DIR/match_same_arms2.rs:33:15
48    |
49 LL |         42 => foo(),
50    |               ^^^^^
51 help: consider refactoring into `42 | 51`
52   --> $DIR/match_same_arms2.rs:33:9
53    |
54 LL |         42 => foo(),
55    |         ^^
56
57 error: this `match` has identical arm bodies
58   --> $DIR/match_same_arms2.rs:40:17
59    |
60 LL |         None => 24, //~ ERROR match arms have same body
61    |                 ^^
62    |
63 note: same as this
64   --> $DIR/match_same_arms2.rs:39:20
65    |
66 LL |         Some(_) => 24,
67    |                    ^^
68 help: consider refactoring into `Some(_) | None`
69   --> $DIR/match_same_arms2.rs:39:9
70    |
71 LL |         Some(_) => 24,
72    |         ^^^^^^^
73
74 error: this `match` has identical arm bodies
75   --> $DIR/match_same_arms2.rs:62:28
76    |
77 LL |         (None, Some(a)) => bar(a), //~ ERROR match arms have same body
78    |                            ^^^^^^
79    |
80 note: same as this
81   --> $DIR/match_same_arms2.rs:61:28
82    |
83 LL |         (Some(a), None) => bar(a),
84    |                            ^^^^^^
85 help: consider refactoring into `(Some(a), None) | (None, Some(a))`
86   --> $DIR/match_same_arms2.rs:61:9
87    |
88 LL |         (Some(a), None) => bar(a),
89    |         ^^^^^^^^^^^^^^^
90
91 error: this `match` has identical arm bodies
92   --> $DIR/match_same_arms2.rs:68:26
93    |
94 LL |         (.., Some(a)) => bar(a), //~ ERROR match arms have same body
95    |                          ^^^^^^
96    |
97 note: same as this
98   --> $DIR/match_same_arms2.rs:67:26
99    |
100 LL |         (Some(a), ..) => bar(a),
101    |                          ^^^^^^
102 help: consider refactoring into `(Some(a), ..) | (.., Some(a))`
103   --> $DIR/match_same_arms2.rs:67:9
104    |
105 LL |         (Some(a), ..) => bar(a),
106    |         ^^^^^^^^^^^^^
107
108 error: this `match` has identical arm bodies
109   --> $DIR/match_same_arms2.rs:102:29
110    |
111 LL |         (Ok(_), Some(x)) => println!("ok {}", x),
112    |                             ^^^^^^^^^^^^^^^^^^^^
113    |
114 note: same as this
115   --> $DIR/match_same_arms2.rs:101:29
116    |
117 LL |         (Ok(x), Some(_)) => println!("ok {}", x),
118    |                             ^^^^^^^^^^^^^^^^^^^^
119 help: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
120   --> $DIR/match_same_arms2.rs:101:9
121    |
122 LL |         (Ok(x), Some(_)) => println!("ok {}", x),
123    |         ^^^^^^^^^^^^^^^^
124    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
125
126 error: this `match` has identical arm bodies
127   --> $DIR/match_same_arms2.rs:117:18
128    |
129 LL |         Ok(_) => println!("ok"),
130    |                  ^^^^^^^^^^^^^^
131    |
132 note: same as this
133   --> $DIR/match_same_arms2.rs:116:18
134    |
135 LL |         Ok(3) => println!("ok"),
136    |                  ^^^^^^^^^^^^^^
137 help: consider refactoring into `Ok(3) | Ok(_)`
138   --> $DIR/match_same_arms2.rs:116:9
139    |
140 LL |         Ok(3) => println!("ok"),
141    |         ^^^^^
142    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
143
144 error: aborting due to 7 previous errors
145