Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken nightly: Const fn union workaround #52

Closed

Conversation

XOSplicer
Copy link
Contributor

This PR fixes the latest issues with the nightly build.
It is a follow up to #51

Instead of using a const fn version of mem::uninitialized, an ManuallyDrop<Uninit<T>> wrapper is used.
The Uninit struct implements Deref T. This code is extreme unsafe, beware of dragons.

However the tests seem to pass, so at least the workaround seems to work.

whentze and others added 4 commits August 14, 2018 23:48
This crate currently fails to compile on the newest nightly when using the "const-fn" feature because unions in const fns now require a feature flag. This change adds the feature flag when using that feature.
@japaric
Copy link
Member

japaric commented Aug 19, 2018

Thanks for the PR, @XOSplicer.

I have opted for using the MaybeUninit API proposed in rust-lang/rfcs#1892 (see PR #55). When that API lands in core it should be easy to replace our implementation with the standard one!

@bors bors bot closed this in #55 Aug 19, 2018
@XOSplicer XOSplicer deleted the const-fn-union-workaround branch May 31, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants