Skip to content

Commit 97bd45b

Browse files
authored
Rollup merge of #88361 - WaffleLapkin:patch-2, r=jyn514
Makes docs for references a little less confusing - Make clear that the `Pointer` trait is related to formatting - Make clear that the `Pointer` trait is implemented for references (previously it was confusing to first see that it's implemented and then see it in "expect") - Make clear that `&T` (shared reference) implements `Send` (if `T: Send + Sync`)
2 parents a77da2d + cdb0c29 commit 97bd45b

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

library/core/src/primitive_docs.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1104,11 +1104,10 @@ mod prim_usize {}
11041104
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
11051105
/// * [`Deref`]
11061106
/// * [`Borrow`]
1107-
/// * [`Pointer`]
1107+
/// * [`fmt::Pointer`]
11081108
///
11091109
/// [`Deref`]: ops::Deref
11101110
/// [`Borrow`]: borrow::Borrow
1111-
/// [`Pointer`]: fmt::Pointer
11121111
///
11131112
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
11141113
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -1124,7 +1123,7 @@ mod prim_usize {}
11241123
/// The following traits are implemented on `&T` references if the underlying `T` also implements
11251124
/// that trait:
11261125
///
1127-
/// * All the traits in [`std::fmt`] except [`Pointer`] and [`fmt::Write`]
1126+
/// * All the traits in [`std::fmt`] except [`fmt::Pointer`] (which is implemented regardless of the type of its referent) and [`fmt::Write`]
11281127
/// * [`PartialOrd`]
11291128
/// * [`Ord`]
11301129
/// * [`PartialEq`]
@@ -1133,9 +1132,9 @@ mod prim_usize {}
11331132
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
11341133
/// * [`Hash`]
11351134
/// * [`ToSocketAddrs`]
1135+
/// * [`Send`] \(`&T` references also require <code>T: [Sync]</code>)
11361136
///
11371137
/// [`std::fmt`]: fmt
1138-
/// ['Pointer`]: fmt::Pointer
11391138
/// [`Hash`]: hash::Hash
11401139
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
11411140
///
@@ -1150,7 +1149,6 @@ mod prim_usize {}
11501149
/// * [`ExactSizeIterator`]
11511150
/// * [`FusedIterator`]
11521151
/// * [`TrustedLen`]
1153-
/// * [`Send`] \(note that `&T` references only get `Send` if <code>T: [Sync]</code>)
11541152
/// * [`io::Write`]
11551153
/// * [`Read`]
11561154
/// * [`Seek`]

library/std/src/primitive_docs.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1104,11 +1104,10 @@ mod prim_usize {}
11041104
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
11051105
/// * [`Deref`]
11061106
/// * [`Borrow`]
1107-
/// * [`Pointer`]
1107+
/// * [`fmt::Pointer`]
11081108
///
11091109
/// [`Deref`]: ops::Deref
11101110
/// [`Borrow`]: borrow::Borrow
1111-
/// [`Pointer`]: fmt::Pointer
11121111
///
11131112
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
11141113
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -1124,7 +1123,7 @@ mod prim_usize {}
11241123
/// The following traits are implemented on `&T` references if the underlying `T` also implements
11251124
/// that trait:
11261125
///
1127-
/// * All the traits in [`std::fmt`] except [`Pointer`] and [`fmt::Write`]
1126+
/// * All the traits in [`std::fmt`] except [`fmt::Pointer`] (which is implemented regardless of the type of its referent) and [`fmt::Write`]
11281127
/// * [`PartialOrd`]
11291128
/// * [`Ord`]
11301129
/// * [`PartialEq`]
@@ -1133,9 +1132,9 @@ mod prim_usize {}
11331132
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
11341133
/// * [`Hash`]
11351134
/// * [`ToSocketAddrs`]
1135+
/// * [`Send`] \(`&T` references also require <code>T: [Sync]</code>)
11361136
///
11371137
/// [`std::fmt`]: fmt
1138-
/// ['Pointer`]: fmt::Pointer
11391138
/// [`Hash`]: hash::Hash
11401139
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
11411140
///
@@ -1150,7 +1149,6 @@ mod prim_usize {}
11501149
/// * [`ExactSizeIterator`]
11511150
/// * [`FusedIterator`]
11521151
/// * [`TrustedLen`]
1153-
/// * [`Send`] \(note that `&T` references only get `Send` if <code>T: [Sync]</code>)
11541152
/// * [`io::Write`]
11551153
/// * [`Read`]
11561154
/// * [`Seek`]

0 commit comments

Comments
 (0)