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

const AtomicCell::new #439

Closed
Arnaz87 opened this issue Oct 23, 2019 · 4 comments
Closed

const AtomicCell::new #439

Arnaz87 opened this issue Oct 23, 2019 · 4 comments

Comments

@Arnaz87
Copy link

Arnaz87 commented Oct 23, 2019

Is there a reason for it not being const? UnsafeCell::new is already const, but it is unsafe so I don't know if there's any reason for Atomic not being const

@taiki-e
Copy link
Member

taiki-e commented Oct 23, 2019

AtomicCell::new is now const fn in #437.

@Arnaz87
Copy link
Author

Arnaz87 commented Oct 23, 2019

nice, just in time

@Arnaz87 Arnaz87 closed this as completed Oct 23, 2019
@Arnaz87
Copy link
Author

Arnaz87 commented Oct 23, 2019

Wait, why is it behind a feature?

@taiki-e
Copy link
Member

taiki-e commented Oct 23, 2019

Wait, why is it behind a feature?

The minimum supported version of crossbeam is Rust 1.28, but const fn requires Rust 1.31. So AtomicCell::new becomes const fn in Rust 1.31 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants