Skip to content

Commit eeee5a8

Browse files
committed
Makes docs for references a little less confusing
- Make clear that the `Pointer` trait is related to formatting - Make clear that `&T` (shared reference) implements `Send` (if `T: Send + Sync`)
1 parent b69fe57 commit eeee5a8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

library/std/src/primitive_docs.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1102,11 +1102,11 @@ mod prim_usize {}
11021102
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
11031103
/// * [`Deref`]
11041104
/// * [`Borrow`]
1105-
/// * [`Pointer`]
1105+
/// * [`fmt::Pointer`]
11061106
///
11071107
/// [`Deref`]: ops::Deref
11081108
/// [`Borrow`]: borrow::Borrow
1109-
/// [`Pointer`]: fmt::Pointer
1109+
/// [`fmt::Pointer`]: fmt::Pointer
11101110
///
11111111
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
11121112
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -1121,7 +1121,7 @@ mod prim_usize {}
11211121
/// The following traits are implemented on `&T` references if the underlying `T` also implements
11221122
/// that trait:
11231123
///
1124-
/// * All the traits in [`std::fmt`] except [`Pointer`] and [`fmt::Write`]
1124+
/// * All the traits in [`std::fmt`] except [`fmt::Pointer`] (which is implemented regardless of the type of its referent) and [`fmt::Write`]
11251125
/// * [`PartialOrd`]
11261126
/// * [`Ord`]
11271127
/// * [`PartialEq`]
@@ -1130,9 +1130,10 @@ mod prim_usize {}
11301130
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
11311131
/// * [`Hash`]
11321132
/// * [`ToSocketAddrs`]
1133+
/// * [`Send`] \(`&T` references also require <code>T: [Sync]</code>)
11331134
///
11341135
/// [`std::fmt`]: fmt
1135-
/// ['Pointer`]: fmt::Pointer
1136+
/// ['fmt::Pointer`]: fmt::Pointer
11361137
/// [`Hash`]: hash::Hash
11371138
/// [`ToSocketAddrs`]: net::ToSocketAddrs
11381139
///
@@ -1147,7 +1148,6 @@ mod prim_usize {}
11471148
/// * [`ExactSizeIterator`]
11481149
/// * [`FusedIterator`]
11491150
/// * [`TrustedLen`]
1150-
/// * [`Send`] \(note that `&T` references only get `Send` if <code>T: [Sync]</code>)
11511151
/// * [`io::Write`]
11521152
/// * [`Read`]
11531153
/// * [`Seek`]

0 commit comments

Comments
 (0)