Commit 184693d
committed
Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochencov
Do not emit type errors on recovered blocks
When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.
Fix #44579.File tree
25 files changed
+111
-40
lines changed- src
- librustc_driver
- librustc_typeck/check
- librustc
- hir
- ich
- libsyntax_ext/deriving
- libsyntax
- ext
- parse
- test
- compile-fail
- parse-fail
- run-pass-fulldeps
- ui
- mismatched_types
- resolve
25 files changed
+111
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
364 | 365 | | |
365 | | - | |
366 | | - | |
367 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
368 | 369 | | |
369 | | - | |
370 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
371 | 373 | | |
372 | | - | |
373 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
374 | 377 | | |
375 | 378 | | |
376 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1790 | 1790 | | |
1791 | 1791 | | |
1792 | 1792 | | |
| 1793 | + | |
1793 | 1794 | | |
1794 | 1795 | | |
1795 | 1796 | | |
| |||
2646 | 2647 | | |
2647 | 2648 | | |
2648 | 2649 | | |
| 2650 | + | |
2649 | 2651 | | |
2650 | 2652 | | |
2651 | 2653 | | |
| |||
3462 | 3464 | | |
3463 | 3465 | | |
3464 | 3466 | | |
| 3467 | + | |
3465 | 3468 | | |
3466 | 3469 | | |
3467 | 3470 | | |
| |||
3565 | 3568 | | |
3566 | 3569 | | |
3567 | 3570 | | |
| 3571 | + | |
3568 | 3572 | | |
3569 | 3573 | | |
3570 | 3574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
623 | 628 | | |
624 | 629 | | |
625 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
387 | 388 | | |
| 389 | + | |
388 | 390 | | |
389 | 391 | | |
390 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
| 732 | + | |
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
| |||
744 | 745 | | |
745 | 746 | | |
746 | 747 | | |
| 748 | + | |
747 | 749 | | |
748 | 750 | | |
749 | 751 | | |
750 | 752 | | |
751 | 753 | | |
752 | | - | |
| 754 | + | |
753 | 755 | | |
754 | 756 | | |
755 | 757 | | |
756 | 758 | | |
757 | 759 | | |
758 | 760 | | |
759 | 761 | | |
760 | | - | |
| 762 | + | |
761 | 763 | | |
762 | 764 | | |
763 | 765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4337 | 4337 | | |
4338 | 4338 | | |
4339 | 4339 | | |
4340 | | - | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
4341 | 4346 | | |
4342 | 4347 | | |
4343 | 4348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
472 | 473 | | |
473 | 474 | | |
474 | 475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
| 597 | + | |
597 | 598 | | |
598 | 599 | | |
599 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
854 | | - | |
| 854 | + | |
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
| 859 | + | |
859 | 860 | | |
860 | 861 | | |
861 | 862 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| 927 | + | |
927 | 928 | | |
928 | 929 | | |
929 | 930 | | |
| |||
0 commit comments