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

Make AtomicCell::is_lock_free always const fn #600

merged 1 commit into from Nov 17, 2020


Copy link

@taiki-e taiki-e commented Nov 17, 2020

if expression can only be used in const fn since Rust 1.46, so const is_lock_free was require Rust 1.46 (context: #531, #546).
However, when we replace uses of if expression with | and & operators, it seems is_lock_free can be used as const fn even in Rust 1.36.

r? @jeehoonkang or @Vtec234

Copy link

@Vtec234 Vtec234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know & was stabilised before &&! In any case, this looks like it should work.

Copy link
Member Author

taiki-e commented Nov 17, 2020

bors r=Vtec234

Copy link

bors bot commented Nov 17, 2020

Build succeeded:

@bors bors bot merged commit 3b14dec into master Nov 17, 2020
@bors bors bot deleted the const_is_lock_free branch November 17, 2020 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Successfully merging this pull request may close these issues.

None yet

2 participants