]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_same_arms.stderr
Auto merge of #4137 - euclio:let-return, r=oli-obk
[rust.git] / tests / ui / match_same_arms.stderr
1 error: this `match` has identical arm bodies
2   --> $DIR/match_same_arms.rs:37: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_arms.rs:28: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_arms.rs:28: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_arms.rs:52:14
42    |
43 LL |         _ => 0, //~ ERROR match arms have same body
44    |              ^
45    |
46 note: same as this
47   --> $DIR/match_same_arms.rs:50:19
48    |
49 LL |         Abc::A => 0,
50    |                   ^
51 note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
52   --> $DIR/match_same_arms.rs:50:19
53    |
54 LL |         Abc::A => 0,
55    |                   ^
56
57 error: this `match` has identical arm bodies
58   --> $DIR/match_same_arms.rs:57:15
59    |
60 LL |         51 => foo(), //~ ERROR match arms have same body
61    |               ^^^^^
62    |
63 note: same as this
64   --> $DIR/match_same_arms.rs:56:15
65    |
66 LL |         42 => foo(),
67    |               ^^^^^
68 help: consider refactoring into `42 | 51`
69   --> $DIR/match_same_arms.rs:56:9
70    |
71 LL |         42 => foo(),
72    |         ^^
73
74 error: this `match` has identical arm bodies
75   --> $DIR/match_same_arms.rs:63:17
76    |
77 LL |         None => 24, //~ ERROR match arms have same body
78    |                 ^^
79    |
80 note: same as this
81   --> $DIR/match_same_arms.rs:62:20
82    |
83 LL |         Some(_) => 24,
84    |                    ^^
85 help: consider refactoring into `Some(_) | None`
86   --> $DIR/match_same_arms.rs:62:9
87    |
88 LL |         Some(_) => 24,
89    |         ^^^^^^^
90
91 error: this `match` has identical arm bodies
92   --> $DIR/match_same_arms.rs:85:28
93    |
94 LL |         (None, Some(a)) => bar(a), //~ ERROR match arms have same body
95    |                            ^^^^^^
96    |
97 note: same as this
98   --> $DIR/match_same_arms.rs:84:28
99    |
100 LL |         (Some(a), None) => bar(a),
101    |                            ^^^^^^
102 help: consider refactoring into `(Some(a), None) | (None, Some(a))`
103   --> $DIR/match_same_arms.rs:84:9
104    |
105 LL |         (Some(a), None) => bar(a),
106    |         ^^^^^^^^^^^^^^^
107
108 error: this `match` has identical arm bodies
109   --> $DIR/match_same_arms.rs:91:26
110    |
111 LL |         (.., Some(a)) => bar(a), //~ ERROR match arms have same body
112    |                          ^^^^^^
113    |
114 note: same as this
115   --> $DIR/match_same_arms.rs:90:26
116    |
117 LL |         (Some(a), ..) => bar(a),
118    |                          ^^^^^^
119 help: consider refactoring into `(Some(a), ..) | (.., Some(a))`
120   --> $DIR/match_same_arms.rs:90:9
121    |
122 LL |         (Some(a), ..) => bar(a),
123    |         ^^^^^^^^^^^^^
124
125 error: this `match` has identical arm bodies
126   --> $DIR/match_same_arms.rs:97:20
127    |
128 LL |         (.., 3) => 42, //~ ERROR match arms have same body
129    |                    ^^
130    |
131 note: same as this
132   --> $DIR/match_same_arms.rs:96:23
133    |
134 LL |         (1, .., 3) => 42,
135    |                       ^^
136 help: consider refactoring into `(1, .., 3) | (.., 3)`
137   --> $DIR/match_same_arms.rs:96:9
138    |
139 LL |         (1, .., 3) => 42,
140    |         ^^^^^^^^^^
141
142 error: this `match` has identical arm bodies
143   --> $DIR/match_same_arms.rs:114:15
144    |
145 LL |         51 => 1, //~ ERROR match arms have same body
146    |               ^
147    |
148 note: same as this
149   --> $DIR/match_same_arms.rs:113:15
150    |
151 LL |         42 => 1,
152    |               ^
153 help: consider refactoring into `42 | 51`
154   --> $DIR/match_same_arms.rs:113:9
155    |
156 LL |         42 => 1,
157    |         ^^
158
159 error: this `match` has identical arm bodies
160   --> $DIR/match_same_arms.rs:116:15
161    |
162 LL |         52 => 2, //~ ERROR match arms have same body
163    |               ^
164    |
165 note: same as this
166   --> $DIR/match_same_arms.rs:115:15
167    |
168 LL |         41 => 2,
169    |               ^
170 help: consider refactoring into `41 | 52`
171   --> $DIR/match_same_arms.rs:115:9
172    |
173 LL |         41 => 2,
174    |         ^^
175
176 error: this `match` has identical arm bodies
177   --> $DIR/match_same_arms.rs:122:14
178    |
179 LL |         2 => 2, //~ ERROR 2nd matched arms have same body
180    |              ^
181    |
182 note: same as this
183   --> $DIR/match_same_arms.rs:121:14
184    |
185 LL |         1 => 2,
186    |              ^
187 help: consider refactoring into `1 | 2`
188   --> $DIR/match_same_arms.rs:121:9
189    |
190 LL |         1 => 2,
191    |         ^
192
193 error: this `match` has identical arm bodies
194   --> $DIR/match_same_arms.rs:123:14
195    |
196 LL |         3 => 2, //~ ERROR 3rd matched arms have same body
197    |              ^
198    |
199 note: same as this
200   --> $DIR/match_same_arms.rs:121:14
201    |
202 LL |         1 => 2,
203    |              ^
204 help: consider refactoring into `1 | 3`
205   --> $DIR/match_same_arms.rs:121:9
206    |
207 LL |         1 => 2,
208    |         ^
209
210 error: this `match` has identical arm bodies
211   --> $DIR/match_same_arms.rs:123:14
212    |
213 LL |         3 => 2, //~ ERROR 3rd matched arms have same body
214    |              ^
215    |
216 note: same as this
217   --> $DIR/match_same_arms.rs:122:14
218    |
219 LL |         2 => 2, //~ ERROR 2nd matched arms have same body
220    |              ^
221 help: consider refactoring into `2 | 3`
222   --> $DIR/match_same_arms.rs:122:9
223    |
224 LL |         2 => 2, //~ ERROR 2nd matched arms have same body
225    |         ^
226
227 error: aborting due to 12 previous errors
228