Primitive docs: fix confusing Send in &T's list#119424
Merged
bors merged 1 commit intorust-lang:masterfrom Dec 30, 2023
Merged
Conversation
The two lists in this document describe what traits are implemented on references when their underlying `T` also implements them. However, while it is true that `T: Send + Sync` implies `&T: Send` (which is what the sentence is trying to explain), it is confusing to have `Send` in the list because `T: Send` is not needed for that. In particular, the "also require" part may be interpreted as "both `T: Send` and `T: Sync` are required". Instead, move `Send` back to where it was before commit 7a47786 ("Makes docs for references a little less confusing"), i.e. to the `&mut` list (where no extra nota is needed, i.e. it fits naturally) and move the `Sync` definition/note to the bottom as something independent. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Collaborator
|
(rustbot has picked a reviewer for you, use r? to override) |
est31
approved these changes
Dec 30, 2023
Member
|
@bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 30, 2023
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#119158 (Clean up alloc::sync::Weak Clone implementation) - rust-lang#119386 (fix typo in `IpAddr::to_canonical`) - rust-lang#119413 (solaris support on bootstrap lock) - rust-lang#119424 (Primitive docs: fix confusing `Send` in `&T`'s list) - rust-lang#119425 (Fix invalid check-cfg Cargo feature diagnostic help) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 30, 2023
Rollup merge of rust-lang#119424 - ojeda:send-sync, r=est31 Primitive docs: fix confusing `Send` in `&T`'s list The two lists in this document describe what traits are implemented on references when their underlying `T` also implements them. However, while it is true that `T: Send + Sync` implies `&T: Send` (which is what the sentence is trying to explain), it is confusing to have `Send` in the list because `T: Send` is not needed for that. In particular, the "also require" part may be interpreted as "both `T: Send` and `T: Sync` are required". Instead, move `Send` back to where it was before commit 7a47786 ("Makes docs for references a little less confusing"), i.e. to the `&mut` list (where no extra nota is needed, i.e. it fits naturally) and move the `Sync` definition/note to the bottom as something independent.
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.
The two lists in this document describe what traits are implemented on references when their underlying
Talso implements them. However, while it is true thatT: Send + Syncimplies&T: Send(which is what the sentence is trying to explain), it is confusing to haveSendin the list becauseT: Sendis not needed for that. In particular, the "also require" part may be interpreted as "bothT: SendandT: Syncare required".Instead, move
Sendback to where it was before commit 7a47786 ("Makes docs for references a little less confusing"), i.e. to the&mutlist (where no extra nota is needed, i.e. it fits naturally) and move theSyncdefinition/note to the bottom as something independent.