Commit b7972e5
committed
Auto merge of rust-lang#16533 - Nadrieril:update-pat-ana, r=HKalbasi
Update to latest `rustc_pattern_analysis`
Here I go again. Two improvements this time.
1. I've removed the need for an arena for patterns. Turns out this wasn't gaining any performance on the rustc side so may as well allocate normally.
2. I've added a clean error path when types don't match, so rustc_pattern_analysis should never panic except internal logic errors. For now `cx.bug()` calls `never!()` but I'm not sure what `never!()` does. Does it display anything to the user? Otherwise a `debug!()` should be sufficient.
Point 2 should fix rust-lang/rust-analyzer#15883 but I haven't tested it because I'm not sure how to reproduce. Could someone give me pointers as to how to write a test for the pattern code?File tree
5 files changed
+52
-43
lines changed- crates
- hir-ty/src/diagnostics
- match_check
- ide-diagnostics/src/handlers
5 files changed
+52
-43
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
| 172 | + | |
174 | 173 | | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
226 | | - | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
248 | | - | |
| 249 | + | |
249 | 250 | | |
250 | 251 | | |
251 | | - | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
Lines changed: 18 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 54 | + | |
61 | 55 | | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
65 | | - | |
| 59 | + | |
66 | 60 | | |
67 | 61 | | |
68 | 62 | | |
| |||
131 | 125 | | |
132 | 126 | | |
133 | 127 | | |
134 | | - | |
| 128 | + | |
135 | 129 | | |
136 | | - | |
| 130 | + | |
137 | 131 | | |
138 | 132 | | |
139 | 133 | | |
140 | 134 | | |
141 | 135 | | |
142 | | - | |
| 136 | + | |
143 | 137 | | |
144 | 138 | | |
145 | 139 | | |
| |||
157 | 151 | | |
158 | 152 | | |
159 | 153 | | |
160 | | - | |
| 154 | + | |
161 | 155 | | |
162 | 156 | | |
163 | 157 | | |
| |||
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
169 | | - | |
| 163 | + | |
170 | 164 | | |
171 | 165 | | |
172 | 166 | | |
| |||
216 | 210 | | |
217 | 211 | | |
218 | 212 | | |
219 | | - | |
220 | | - | |
| 213 | + | |
221 | 214 | | |
222 | 215 | | |
223 | 216 | | |
224 | 217 | | |
225 | 218 | | |
226 | 219 | | |
227 | | - | |
| 220 | + | |
228 | 221 | | |
229 | 222 | | |
230 | 223 | | |
231 | 224 | | |
232 | | - | |
| 225 | + | |
233 | 226 | | |
234 | 227 | | |
235 | 228 | | |
236 | 229 | | |
237 | 230 | | |
238 | | - | |
| 231 | + | |
239 | 232 | | |
240 | 233 | | |
241 | 234 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 235 | + | |
246 | 236 | | |
247 | 237 | | |
248 | 238 | | |
| |||
307 | 297 | | |
308 | 298 | | |
309 | 299 | | |
310 | | - | |
| 300 | + | |
311 | 301 | | |
312 | 302 | | |
313 | 303 | | |
| |||
463 | 453 | | |
464 | 454 | | |
465 | 455 | | |
466 | | - | |
| 456 | + | |
467 | 457 | | |
468 | 458 | | |
469 | 459 | | |
| |||
485 | 475 | | |
486 | 476 | | |
487 | 477 | | |
488 | | - | |
489 | | - | |
| 478 | + | |
| 479 | + | |
490 | 480 | | |
491 | 481 | | |
492 | 482 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
313 | 331 | | |
314 | 332 | | |
315 | 333 | | |
| |||
0 commit comments