Use cfg(target_has_atomic) on no-std targets to support platforms without atomic CAS (no dep)#761
Closed
Use cfg(target_has_atomic) on no-std targets to support platforms without atomic CAS (no dep)#761
Conversation
Member
|
Sorry for the delays on the other PR. I'm okay with adding this, though I have one question: If we go through with #479, would that make this PR redundant? It would let you compile out the |
Member
|
Let's just go ahead with #467. I'm happy to merge that one with the changes requested there. |
This file contains hidden or 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
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.
This does not replace #467 ("Add feature to support platforms without atomic CAS"), but is sufficient to fix #461 in use cases that do not need
Bytes/BytesMut. (i.e., What some of the people who say we need #479 ("Make alloc optional") actually need.)The following documentation added by this PR should explain exactly the status of the API after this PR is merged and its relationship to #467:
This implements the first one listed in #573 (comment).
The concern with this approach was MSRV of the
cfg(target_os = "none")targets, but I have been using this approach with futures-rs for over a year and have not received any complaints about this. Below is an explanation to this MSRV concern from futures-rs PR (rust-lang/futures-rs#2811) that implemented it.(Btw, futures-rs also implements the same approach as #467, not only this.)