-
Notifications
You must be signed in to change notification settings - Fork 471
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
Remove uses of unstable feature(cfg_target_has_atomic) #698
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I appreciate the work, I recently encountered this issue. |
taiki-e
force-pushed
the
no-atomic-cas
branch
5 times, most recently
from
May 23, 2021 04:56
76f9e2e
to
138c956
Compare
taiki-e
commented
May 27, 2021
done | ||
echo "];" >>"$file" | ||
|
||
# There is no `"max-atomic-width" == 16` or `"max-atomic-width" == 8` targets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both "avr-unknown-gnu-atmega328" and "msp430-none-elf", which are "target-pointer-width" == "16"
, do not support atomic:
taiki-e
force-pushed
the
no-atomic-cas
branch
4 times, most recently
from
May 27, 2021 13:09
debc101
to
361edc9
Compare
Detect platforms that do not support AtomicU64 by using the same way. AFAIK, this is more robust than the current way that uses autocfg. See also rust-lang/futures-rs#2294.
bors r+ |
Build succeeded: |
bors bot
added a commit
that referenced
this pull request
May 30, 2021
707: Prepare for the next release r=taiki-e a=taiki-e - crossbeam-epoch 0.9.4 -> 0.9.5 - Fix UB in `Pointable` impl of `[MaybeUninit<T>]` (#694) - Support targets that do not have atomic CAS on stable Rust (#698) - Fix breakage with nightly feature due to rust-lang/rust#84510 (#692) - crossbeam-queue 0.3.1 -> 0.3.2 - Support targets that do not have atomic CAS on stable Rust (#698) - crossbeam-utils 0.8.4 -> 0.8.5 - Add `AtomicCell::fetch_update` (#704) - Support targets that do not have atomic CAS on stable Rust (#698) - crossbeam 0.8.0 -> 0.8.1 - Support targets that do not have atomic CAS on stable Rust (#698) Closes #702 Co-authored-by: Taiki Endo <te316e89@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some no-std targets (e.g., ARMv6-M) do not support atomic CAS operations and cannot use Arc, etc.
Currently, we are using an unstable feature to detect them, but it has caused breakage in the past (#435).
Also, users of stable Rust are not able to compile crossbeam on those targets.
Instead of depending on unstable features of the compiler, this patch detects those targets using the TARGET environment variables provided by cargo for the build script, and a list of targets that do not support atomic CAS operations.
This way is the same as the way we recently adopted in futures and valuable, and was originally inspired by the way heapless and defmt do, but this doesn't maintain the target list manually. (It's not really fully automated, but it's very easy to update.)
Also, this completely removes the dependency on unstable features from crates other than crossbeam-epoch.
refs: rust-lang/rust#51953, rust-lang/futures-rs#2400, tokio-rs/valuable#12