rust/compiler/rustc_mir
bors 10b3595ba6 Auto merge of #76411 - RalfJung:promote-in-const-fn, r=ecstatic-morse
Some promotion cleanup

Based on top of both https://github.com/rust-lang/rust/pull/75502 and https://github.com/rust-lang/rust/pull/75585, this does some cleanup of the promotion code. The last 2 commits are new.

* Remove the remaining cases where `const fn` is treated different from `fn`. This means no longer promoting ptr-to-int casts, raw ptr operations, and union field accesses in `const fn` -- or anywhere, for that matter. These are all unstable in const-context so this should not break any stable code. Fixes https://github.com/rust-lang/rust/issues/75586.
* ~~Promote references to statics even outside statics (i.e., in functions) for consistency.~~
* Promote `&mut []` everywhere, not just in non-`const` functions, for consistency.
* Explain why we do not promote deref's of statics outside statics. ~~(This is the only remaining direct user of `const_kind`.)~~

This can only land once the other two PRs land; I am mostly putting this up already because I couldn't wait ;) and to get some feedback from `@rust-lang/wg-const-eval` .
2020-09-20 06:20:16 +00:00
..
src Auto merge of #76411 - RalfJung:promote-in-const-fn, r=ecstatic-morse 2020-09-20 06:20:16 +00:00
Cargo.toml update the version of itertools and parking_lot 2020-09-12 08:26:53 +02:00