Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdate union code to use ManuallyDrop #135
Conversation
A Rust breaking change to the untagged_unions feature, means that no union fields may have destructors, so we need use ManuallyDrop also around the inline union field.
e78b4da
to
d6bfa84
|
This change takes us further on the road to stable unions for SmallVec |
|
@bors-servo r+ Thanks! |
|
|
…beck Update union code to use ManuallyDrop At the time of this writing, this breaking change is *proposed*, see rust-lang/rust/pull/56440. Smallvec would have to be updated before the change can be merged upstream. Thanks! A Rust breaking change to the untagged_unions feature means that no union fields may have destructors, so we need use ManuallyDrop also around the inline union field. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/135) <!-- Reviewable:end -->
|
|
|
I've reviewed the surrounding code, and it's a bit hard to talk about soundness with the unsafe code guidelines making a rumbling noise in the background, but without clear pronouncements. One place of worry about this PR could be if there is a practical difference of uninitialized value inside With MaybeUninit the question remains about partial initialization and the soundness of forming |
Version 0.6.8 Change log: * Don't leak memory if an iterator panics during `extend` (#137) * Update the unstable `union` feature for better forward compatibility (#135) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/138) <!-- Reviewable:end -->
bluss commentedDec 19, 2018
•
edited
At the time of this writing, this breaking change is proposed, see rust-lang/rust/pull/56440.
Smallvec would have to be updated before the change can be merged upstream. Thanks!
A Rust breaking change to the untagged_unions feature means that no
union fields may have destructors, so we need use ManuallyDrop also
around the inline union field.
This change is