Commit 9718f7a
authored
Rollup merge of rust-lang#64005 - ecstatic-morse:is-indirect, r=oli-obk
Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection
Working on rust-lang#63860 requires tracking some property about each local. This requires differentiating `Place`s like `x` and `x.field[index]` from ones like `*x` and `*x.field`, since the first two will always access the same region of memory as `x` while the latter two may access any region of memory. This functionality is duplicated in various places across the compiler. This PR adds a helper method to `Place` which determines whether that `Place` has a `Deref` projection at any point and changes some existing code to use the new method.
I've not converted `qualify_consts.rs` to use the new method, since it's not a trivial conversion and it will get replaced anyway by rust-lang#63860. There may be other potential uses besides the two I change in this PR.
r? @oli-obkFile tree
3 files changed
+36
-29
lines changed- src
- librustc_mir
- borrow_check
- dataflow/impls
- librustc/mir
3 files changed
+36
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1808 | 1808 | | |
1809 | 1809 | | |
1810 | 1810 | | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
1811 | 1828 | | |
1812 | 1829 | | |
1813 | 1830 | | |
| |||
1869 | 1886 | | |
1870 | 1887 | | |
1871 | 1888 | | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
1872 | 1897 | | |
1873 | 1898 | | |
1874 | 1899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 136 | + | |
| 137 | + | |
149 | 138 | | |
150 | | - | |
151 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
152 | 143 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
109 | 100 | | |
110 | 101 | | |
111 | 102 | | |
| |||
0 commit comments