-
Notifications
You must be signed in to change notification settings - Fork 472
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
Use cfg(target_has_atomic) instead of hard coding which targets support atomics #1033
Comments
This is an approach I have previously explicitly stated I accept and would accept a PR that implements this. |
Do you know how to handle |
Yes.
|
Is adding autocfg as build dependency to the crates that don't have it yet fine? |
Yeah, it's fine. That said, given that #1015 will increase MSRV to 1.59, it would also actually be fine to increase MSRV to 1.60 or 1.61 and remove the need for build scripts. (I had forgotten about that PR when I first commented in this issue.) |
I think I will wait for that PR. |
This has been stable since 1.60.0: rust-lang/rust#93824 The hard coded list is bound to go out of sync with rustc, especially when new targets get added. As rustc itself depends on crossbeam, this means it isn't possible to build rustc for targets lacking some atomics until a new crossbeam release with those new targets. Using
cfg(target_has_atomic)
will immediately work. While the MSRV of crossbeam is lower than 1.60.0, it should be possible to use the hard coded list as fallback when the rustc version is too old for stablecfg(target_has_atomic)
.The text was updated successfully, but these errors were encountered: