|
1 | 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 |
| 2 | + --> $DIR/match_same_arms.rs:13:14 |
42 | 3 | | |
43 | 4 | LL | _ => 0, //~ ERROR match arms have same body |
44 | 5 | | ^ |
45 | 6 | | |
| 7 | + = note: `-D clippy::match-same-arms` implied by `-D warnings` |
46 | 8 | note: same as this |
47 | | - --> $DIR/match_same_arms.rs:50:19 |
| 9 | + --> $DIR/match_same_arms.rs:11:19 |
48 | 10 | | |
49 | 11 | LL | Abc::A => 0, |
50 | 12 | | ^ |
51 | 13 | note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it |
52 | | - --> $DIR/match_same_arms.rs:50:19 |
| 14 | + --> $DIR/match_same_arms.rs:11:19 |
53 | 15 | | |
54 | 16 | LL | Abc::A => 0, |
55 | 17 | | ^ |
56 | 18 |
|
57 | 19 | 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 |
| 20 | + --> $DIR/match_same_arms.rs:18:20 |
127 | 21 | | |
128 | 22 | LL | (.., 3) => 42, //~ ERROR match arms have same body |
129 | 23 | | ^^ |
130 | 24 | | |
131 | 25 | note: same as this |
132 | | - --> $DIR/match_same_arms.rs:96:23 |
| 26 | + --> $DIR/match_same_arms.rs:17:23 |
133 | 27 | | |
134 | 28 | LL | (1, .., 3) => 42, |
135 | 29 | | ^^ |
136 | 30 | help: consider refactoring into `(1, .., 3) | (.., 3)` |
137 | | - --> $DIR/match_same_arms.rs:96:9 |
| 31 | + --> $DIR/match_same_arms.rs:17:9 |
138 | 32 | | |
139 | 33 | LL | (1, .., 3) => 42, |
140 | 34 | | ^^^^^^^^^^ |
141 | 35 |
|
142 | 36 | error: this `match` has identical arm bodies |
143 | | - --> $DIR/match_same_arms.rs:114:15 |
| 37 | + --> $DIR/match_same_arms.rs:24:15 |
144 | 38 | | |
145 | 39 | LL | 51 => 1, //~ ERROR match arms have same body |
146 | 40 | | ^ |
147 | 41 | | |
148 | 42 | note: same as this |
149 | | - --> $DIR/match_same_arms.rs:113:15 |
| 43 | + --> $DIR/match_same_arms.rs:23:15 |
150 | 44 | | |
151 | 45 | LL | 42 => 1, |
152 | 46 | | ^ |
153 | 47 | help: consider refactoring into `42 | 51` |
154 | | - --> $DIR/match_same_arms.rs:113:9 |
| 48 | + --> $DIR/match_same_arms.rs:23:9 |
155 | 49 | | |
156 | 50 | LL | 42 => 1, |
157 | 51 | | ^^ |
158 | 52 |
|
159 | 53 | error: this `match` has identical arm bodies |
160 | | - --> $DIR/match_same_arms.rs:116:15 |
| 54 | + --> $DIR/match_same_arms.rs:26:15 |
161 | 55 | | |
162 | 56 | LL | 52 => 2, //~ ERROR match arms have same body |
163 | 57 | | ^ |
164 | 58 | | |
165 | 59 | note: same as this |
166 | | - --> $DIR/match_same_arms.rs:115:15 |
| 60 | + --> $DIR/match_same_arms.rs:25:15 |
167 | 61 | | |
168 | 62 | LL | 41 => 2, |
169 | 63 | | ^ |
170 | 64 | help: consider refactoring into `41 | 52` |
171 | | - --> $DIR/match_same_arms.rs:115:9 |
| 65 | + --> $DIR/match_same_arms.rs:25:9 |
172 | 66 | | |
173 | 67 | LL | 41 => 2, |
174 | 68 | | ^^ |
175 | 69 |
|
176 | 70 | error: this `match` has identical arm bodies |
177 | | - --> $DIR/match_same_arms.rs:122:14 |
| 71 | + --> $DIR/match_same_arms.rs:32:14 |
178 | 72 | | |
179 | 73 | LL | 2 => 2, //~ ERROR 2nd matched arms have same body |
180 | 74 | | ^ |
181 | 75 | | |
182 | 76 | note: same as this |
183 | | - --> $DIR/match_same_arms.rs:121:14 |
| 77 | + --> $DIR/match_same_arms.rs:31:14 |
184 | 78 | | |
185 | 79 | LL | 1 => 2, |
186 | 80 | | ^ |
187 | 81 | help: consider refactoring into `1 | 2` |
188 | | - --> $DIR/match_same_arms.rs:121:9 |
| 82 | + --> $DIR/match_same_arms.rs:31:9 |
189 | 83 | | |
190 | 84 | LL | 1 => 2, |
191 | 85 | | ^ |
192 | 86 |
|
193 | 87 | error: this `match` has identical arm bodies |
194 | | - --> $DIR/match_same_arms.rs:123:14 |
| 88 | + --> $DIR/match_same_arms.rs:33:14 |
195 | 89 | | |
196 | 90 | LL | 3 => 2, //~ ERROR 3rd matched arms have same body |
197 | 91 | | ^ |
198 | 92 | | |
199 | 93 | note: same as this |
200 | | - --> $DIR/match_same_arms.rs:121:14 |
| 94 | + --> $DIR/match_same_arms.rs:31:14 |
201 | 95 | | |
202 | 96 | LL | 1 => 2, |
203 | 97 | | ^ |
204 | 98 | help: consider refactoring into `1 | 3` |
205 | | - --> $DIR/match_same_arms.rs:121:9 |
| 99 | + --> $DIR/match_same_arms.rs:31:9 |
206 | 100 | | |
207 | 101 | LL | 1 => 2, |
208 | 102 | | ^ |
209 | 103 |
|
210 | 104 | error: this `match` has identical arm bodies |
211 | | - --> $DIR/match_same_arms.rs:123:14 |
| 105 | + --> $DIR/match_same_arms.rs:33:14 |
212 | 106 | | |
213 | 107 | LL | 3 => 2, //~ ERROR 3rd matched arms have same body |
214 | 108 | | ^ |
215 | 109 | | |
216 | 110 | note: same as this |
217 | | - --> $DIR/match_same_arms.rs:122:14 |
| 111 | + --> $DIR/match_same_arms.rs:32:14 |
218 | 112 | | |
219 | 113 | LL | 2 => 2, //~ ERROR 2nd matched arms have same body |
220 | 114 | | ^ |
221 | 115 | help: consider refactoring into `2 | 3` |
222 | | - --> $DIR/match_same_arms.rs:122:9 |
| 116 | + --> $DIR/match_same_arms.rs:32:9 |
223 | 117 | | |
224 | 118 | LL | 2 => 2, //~ ERROR 2nd matched arms have same body |
225 | 119 | | ^ |
226 | 120 |
|
227 | 121 | error: this `match` has identical arm bodies |
228 | | - --> $DIR/match_same_arms.rs:140:55 |
| 122 | + --> $DIR/match_same_arms.rs:50:55 |
229 | 123 | | |
230 | 124 | LL | CommandInfo::External { name, .. } => name.to_string(), |
231 | 125 | | ^^^^^^^^^^^^^^^^ |
232 | 126 | | |
233 | 127 | note: same as this |
234 | | - --> $DIR/match_same_arms.rs:139:54 |
| 128 | + --> $DIR/match_same_arms.rs:49:54 |
235 | 129 | | |
236 | 130 | LL | CommandInfo::BuiltIn { name, .. } => name.to_string(), |
237 | 131 | | ^^^^^^^^^^^^^^^^ |
238 | 132 | help: consider refactoring into `CommandInfo::BuiltIn { name, .. } | CommandInfo::External { name, .. }` |
239 | | - --> $DIR/match_same_arms.rs:139:17 |
| 133 | + --> $DIR/match_same_arms.rs:49:17 |
240 | 134 | | |
241 | 135 | LL | CommandInfo::BuiltIn { name, .. } => name.to_string(), |
242 | 136 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
243 | 137 |
|
244 | | -error: aborting due to 13 previous errors |
| 138 | +error: aborting due to 8 previous errors |
245 | 139 |
|
0 commit comments