Commit e412043
committed
Fix ICE: Disallow const blocks in patterns and remove ConstBlock from HIR
This fixes the ICE reported in #148138 by explicitly rejecting `const` blocks
in patterns during AST lowering.
Additionally, this commit performs a complete cleanup as suggested by reviewers:
- Removed `PatExprKind::ConstBlock` from HIR as it is no longer reachable.
- Removed `Pat::ConstBlockPat` and related logic from Rust Analyzer.
- Removed special-casing for const blocks in patterns from the parser.
- Removed dead code in `rustc_mir_build` and fixed Clippy adaptors.1 parent 29e035e commit e412043
File tree
17 files changed
+754
-91
lines changed- compiler
- rustc_ast_lowering/src
- rustc_hir_pretty/src
- rustc_hir_typeck/src
- rustc_hir/src
- rustc_mir_build/src/thir/pattern
- src/tools
- clippy
- clippy_lints/src/utils
- clippy_utils/src
- rust-analyzer/crates
- hir-def/src/expr_store
- ide-assists/src
- handlers
- ide-db/src/syntax_helpers
- syntax/src/ast/generated
- tests/ui/pattern/deref-patterns
17 files changed
+754
-91
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
403 | 402 | | |
404 | 403 | | |
405 | 404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1921 | 1921 | | |
1922 | 1922 | | |
1923 | 1923 | | |
1924 | | - | |
1925 | 1924 | | |
1926 | 1925 | | |
1927 | 1926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
792 | | - | |
793 | 792 | | |
794 | 793 | | |
795 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1876 | 1876 | | |
1877 | 1877 | | |
1878 | 1878 | | |
1879 | | - | |
1880 | 1879 | | |
1881 | 1880 | | |
1882 | 1881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
925 | 925 | | |
926 | 926 | | |
927 | 927 | | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | 928 | | |
932 | 929 | | |
933 | 930 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
621 | 620 | | |
622 | 621 | | |
623 | 622 | | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | 623 | | |
670 | 624 | | |
671 | 625 | | |
| |||
677 | 631 | | |
678 | 632 | | |
679 | 633 | | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | 634 | | |
684 | 635 | | |
685 | 636 | | |
| |||
0 commit comments