Commit 5bd9b60
committed
Auto merge of rust-lang#79553 - sexxi-goose:mir_min_cap_writeback, r=nikomatsakis
Capture precise paths in THIR and MIR
This PR allows THIR and MIR to use the result of the new capture analysis to actually capture precise paths
To achieve we:
- Writeback min capture results to TypeckResults
- Move handling upvars to PlaceBuilder in mir_build
- Lower precise paths in THIR build by reading min_captures
- Search for ancestors in min_capture when trying to build a MIR place which starts off of an upvar
Closes: rust-lang/project-rfc-2229#10
Partly implements: rust-lang/project-rfc-2229#18
Work that remains (not in this PR):
- [ ] [Known bugs when feature gate is enabled](https://github.com/rust-lang/project-rfc-2229/projects/1?card_filter_query=label%3Abug)
- [ ] Use min_capure_map for
- [ ] Liveness analysis
- [ ] rustc_mir/interpret/validity.rs
- [ ] regionck
- [ ] rust-lang/project-rfc-2229#8
- [ ] remove closure_captures and upvar_capture_map
r? `@ghost`File tree
41 files changed
+1483
-233
lines changed- compiler
- rustc_middle/src
- hir
- ty
- rustc_mir_build/src
- build
- expr
- thir/cx
- rustc_mir/src/borrow_check
- type_check
- rustc_typeck/src
- check
- src/test/ui/closures/2229_closure_analysis
- diagnostics
- run_pass
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
41 files changed
+1483
-233
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
8 | 19 | | |
9 | 20 | | |
10 | 21 | | |
| |||
16 | 27 | | |
17 | 28 | | |
18 | 29 | | |
19 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
20 | 42 | | |
21 | 43 | | |
22 | 44 | | |
| |||
36 | 58 | | |
37 | 59 | | |
38 | 60 | | |
39 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
40 | 73 | | |
41 | 74 | | |
42 | 75 | | |
| |||
48 | 81 | | |
49 | 82 | | |
50 | 83 | | |
51 | | - | |
| 84 | + | |
52 | 85 | | |
53 | 86 | | |
54 | 87 | | |
| |||
61 | 94 | | |
62 | 95 | | |
63 | 96 | | |
64 | | - | |
| 97 | + | |
65 | 98 | | |
66 | 99 | | |
67 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
627 | 640 | | |
628 | 641 | | |
629 | 642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
675 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
676 | 687 | | |
677 | 688 | | |
678 | 689 | | |
679 | 690 | | |
680 | 691 | | |
681 | 692 | | |
682 | 693 | | |
683 | | - | |
| 694 | + | |
684 | 695 | | |
685 | 696 | | |
686 | 697 | | |
| |||
692 | 703 | | |
693 | 704 | | |
694 | 705 | | |
695 | | - | |
| 706 | + | |
696 | 707 | | |
697 | 708 | | |
698 | 709 | | |
| |||
746 | 757 | | |
747 | 758 | | |
748 | 759 | | |
749 | | - | |
| 760 | + | |
750 | 761 | | |
751 | 762 | | |
752 | 763 | | |
| |||
763 | 774 | | |
764 | 775 | | |
765 | 776 | | |
766 | | - | |
| 777 | + | |
767 | 778 | | |
768 | 779 | | |
769 | 780 | | |
| |||
790 | 801 | | |
791 | 802 | | |
792 | 803 | | |
793 | | - | |
| 804 | + | |
794 | 805 | | |
795 | 806 | | |
796 | 807 | | |
| |||
799 | 810 | | |
800 | 811 | | |
801 | 812 | | |
802 | | - | |
| 813 | + | |
803 | 814 | | |
804 | 815 | | |
805 | 816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2174 | 2174 | | |
2175 | 2175 | | |
2176 | 2176 | | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
2177 | 2186 | | |
2178 | 2187 | | |
2179 | 2188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
753 | 757 | | |
754 | 758 | | |
755 | 759 | | |
| |||
0 commit comments