]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #60590 - petertodd:2018-test-union-nonzero, r=nikomatsakis,Centril
authorMazdak Farrokhzad <twingoow@gmail.com>
Sun, 19 May 2019 23:01:37 +0000 (01:01 +0200)
committerGitHub <noreply@github.com>
Sun, 19 May 2019 23:01:37 +0000 (01:01 +0200)
commitf9d65c000dfa92825589dd1a13a20b95a328493b
treea30423db68035d0500fc8e349abee50ff434bc84
parent6afcb5628523b0baae5704ad34ac1aba8ba10de6
parenta91ad60158647c1f6a89b9c01915279ce9314a65
Rollup merge of #60590 - petertodd:2018-test-union-nonzero, r=nikomatsakis,Centril

Test interaction of unions with non-zero/niche-filling optimization

Notably this nails down part of the behavior that MaybeUninit assumes, e.g. that a Option<MaybeUninit<&u8>> does not take advantage of non-zero optimization, and thus is a safe construct.

It also verifies the status quo: that even unions that could theoretically take advantage of niches don't. (relevant: https://github.com/rust-lang/rust/issues/36394)