Commit e4e7aa2
committed
Auto merge of #21744 - eddyb:rvalue-promotion, r=nikomatsakis
This includes everything necessary for promoting borrows of constant rvalues to `'static`.
That is, `&expr` will have the type `&'static T` if `const T: &'static T = &expr;` is valid.
There is a small exception, dereferences of raw pointers, as they misbehave.
They still "work" in constants as I didn't want to break legitimate uses (are there any?).
The qualification done here can be expanded to allow simple CTFE via `const fn`.File tree
56 files changed
+1898
-1648
lines changed- src
- librand
- librustc_driver
- librustc_llvm
- librustc_trans/trans
- librustc_typeck
- check
- librustc
- lint
- metadata
- middle
- infer
- test
- bench
- compile-fail
- debuginfo
- run-make/issue-7349
- run-pass
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+1898
-1648
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
| 115 | + | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 146 | + | |
158 | 147 | | |
159 | 148 | | |
160 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
1305 | 1307 | | |
1306 | 1308 | | |
1307 | 1309 | | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
1308 | 1319 | | |
1309 | 1320 | | |
1310 | 1321 | | |
| |||
1836 | 1847 | | |
1837 | 1848 | | |
1838 | 1849 | | |
1839 | | - | |
1840 | | - | |
| 1850 | + | |
| 1851 | + | |
1841 | 1852 | | |
1842 | 1853 | | |
1843 | 1854 | | |
| |||
1919 | 1930 | | |
1920 | 1931 | | |
1921 | 1932 | | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
1922 | 1937 | | |
1923 | 1938 | | |
1924 | 1939 | | |
| |||
0 commit comments