Commit 9d44ee1
committed
Unify handling of path diagnostics in hir-ty
Because it was a mess.
Previously, pretty much you had to handle all path diagnostics manually: remember to check for them and handle them. Now, we wrap the resolver in `TyLoweringContext` and ensure proper error reporting.
This means that you don't have to worry about them: most of the things are handled automatically, and things that cannot will create a compile-time error (forcing you top `drop(ty_lowering_context);`) if forgotten, instead of silently dropping the diagnostics.
The real place for error reporting is in the hir-def resolver, because there are other things resolving, both in hir-ty and in hir-def, and they all need to ensure proper diagnostics. But this is a good start, and future compatible.
This commit also ensures proper path diagnostics for value/pattern paths, which is why it's marked "feat".1 parent 932a6d3 commit 9d44ee1
File tree
14 files changed
+848
-247
lines changed- src/tools/rust-analyzer/crates
- hir-def/src
- nameres
- hir-ty/src
- infer
- lower
- hir/src
- ide-diagnostics/src/handlers
14 files changed
+848
-247
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
615 | 617 | | |
616 | 618 | | |
617 | 619 | | |
| 620 | + | |
| 621 | + | |
618 | 622 | | |
619 | 623 | | |
620 | 624 | | |
621 | 625 | | |
622 | 626 | | |
623 | 627 | | |
624 | | - | |
| 628 | + | |
625 | 629 | | |
626 | 630 | | |
627 | 631 | | |
| |||
630 | 634 | | |
631 | 635 | | |
632 | 636 | | |
633 | | - | |
| 637 | + | |
634 | 638 | | |
635 | 639 | | |
636 | 640 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
800 | | - | |
| 800 | + | |
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
| |||
Lines changed: 59 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
51 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
58 | | - | |
| 71 | + | |
59 | 72 | | |
60 | | - | |
| 73 | + | |
61 | 74 | | |
62 | 75 | | |
63 | 76 | | |
| |||
157 | 170 | | |
158 | 171 | | |
159 | 172 | | |
160 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
161 | 184 | | |
162 | 185 | | |
163 | 186 | | |
| |||
403 | 426 | | |
404 | 427 | | |
405 | 428 | | |
406 | | - | |
| 429 | + | |
407 | 430 | | |
408 | 431 | | |
409 | 432 | | |
410 | 433 | | |
411 | 434 | | |
412 | 435 | | |
413 | | - | |
| 436 | + | |
414 | 437 | | |
415 | 438 | | |
416 | 439 | | |
| |||
443 | 466 | | |
444 | 467 | | |
445 | 468 | | |
446 | | - | |
| 469 | + | |
447 | 470 | | |
448 | 471 | | |
449 | 472 | | |
| |||
488 | 511 | | |
489 | 512 | | |
490 | 513 | | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
500 | 528 | | |
501 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
502 | 536 | | |
503 | 537 | | |
504 | 538 | | |
| |||
513 | 547 | | |
514 | 548 | | |
515 | 549 | | |
516 | | - | |
| 550 | + | |
517 | 551 | | |
518 | 552 | | |
519 | 553 | | |
| |||
522 | 556 | | |
523 | 557 | | |
524 | 558 | | |
525 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
526 | 565 | | |
527 | 566 | | |
528 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
| 271 | + | |
269 | 272 | | |
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
273 | 276 | | |
274 | 277 | | |
| 278 | + | |
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| 285 | + | |
281 | 286 | | |
282 | 287 | | |
283 | 288 | | |
284 | 289 | | |
285 | 290 | | |
286 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
287 | 302 | | |
288 | 303 | | |
289 | 304 | | |
| |||
0 commit comments