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

Nightly requirements #1

Open
inquisitivecrystal opened this issue Nov 3, 2018 · 2 comments
Open

Nightly requirements #1

inquisitivecrystal opened this issue Nov 3, 2018 · 2 comments

Comments

@inquisitivecrystal
Copy link
Contributor

I would like to be able to use this without nightly. I think it is now possible to remove the fnbox feature. This means the only feature I don't know how to remove is the untagged_unions feature. @sdleffler, can you explain why unions are necessary?

@sdleffler
Copy link
Owner

Hi! Frankly I can't remember any exact reasons why I decided against enums for the unsync implementation. I think it had to do with a combination of safety and efficiency, and a desire to keep its implementation similar to the synchronous one. For the synchronous thunk implementation, I definitely did it because I needed an atomic enum discriminant; so I separated what would have been a regular Rust enum it into an AtomicUsize and then the untagged union. Again, you could rewrite it with an enum, but it would add the space for a discriminant which is redundant with the atomic discriminant.

@inquisitivecrystal
Copy link
Contributor Author

If I'm reading rust-lang/rfcs#2514 correctly, there's likely to be a solution for this in the near- to mid- term future. So it probably makes sense just to wait for that. I may have some other PRs for you though. Thanks for being so responsive!

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

No branches or pull requests

2 participants