This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit d317da4
authored
Rollup merge of rust-lang#91325 - RalfJung:const_eval_select, r=dtolnay
adjust const_eval_select documentation
"The Rust compiler assumes" indicates that this is language UB, but [I don't think that is a good idea](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/const_eval_select.20assumptions). This UB would be very hard to test for and looks like a way-too-big footgun. ``@oli-obk`` suggested this is meant to be more like "library UB", so I tried to adjust the docs accordingly.
I also removed all references to "referential transparency". That is a rather vague concept used to mean many different things, and I honestly have no idea what exactly is meant by it in this specific instance. But I assume ``@fee1-dead`` had in their mind a property that all `const fn` code upholds, so by demanding that the runtime code and the const-time code are *observably equivalent*, whatever that property is would also be enforced here.
Cc ``@rust-lang/wg-const-eval``2 files changed
+37
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2070 | 2070 | | |
2071 | 2071 | | |
2072 | 2072 | | |
2073 | | - | |
2074 | | - | |
| 2073 | + | |
| 2074 | + | |
2075 | 2075 | | |
2076 | 2076 | | |
2077 | 2077 | | |
| |||
2161 | 2161 | | |
2162 | 2162 | | |
2163 | 2163 | | |
2164 | | - | |
2165 | | - | |
| 2164 | + | |
| 2165 | + | |
2166 | 2166 | | |
2167 | 2167 | | |
2168 | 2168 | | |
| |||
2273 | 2273 | | |
2274 | 2274 | | |
2275 | 2275 | | |
2276 | | - | |
2277 | | - | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
2278 | 2281 | | |
2279 | | - | |
2280 | | - | |
2281 | | - | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
2282 | 2287 | | |
2283 | | - | |
2284 | | - | |
2285 | | - | |
2286 | | - | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
2287 | 2292 | | |
2288 | | - | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
2289 | 2310 | | |
2290 | 2311 | | |
2291 | 2312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
| 152 | + | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
0 commit comments