]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #66642 - ecstatic-morse:promotion-in-const, r=eddyb
authorbors <bors@rust-lang.org>
Thu, 28 Nov 2019 17:30:24 +0000 (17:30 +0000)
committerbors <bors@rust-lang.org>
Thu, 28 Nov 2019 17:30:24 +0000 (17:30 +0000)
commitbbb664a99c0188fa756cbbb3a6c4e5d8825c372b
tree494cd4de8851dc0bae103a4f8e9f8293348e4fc3
parentf453d1127d9095cf3c3356655d9e8502ceeb8373
parentf9ed2199ff5a69b88d43949c138042a42ecd98b5
Auto merge of #66642 - ecstatic-morse:promotion-in-const, r=eddyb

Create promoted MIR fragments for `const` and `static`s

Resolves #65732.

The previous strategy of removing `Drop` and `StorageDead` for promoted locals only worked for rvalue lifetime extension and only if no `loop`s were present. This PR applies the approach currently used for `fn` and `const fn`s to `const` and `statics`.

This may have some performance impacts.

r? @eddyb
src/librustc_mir/transform/promote_consts.rs