Skip to content

Commit bfdaab8

Browse files
authoredOct 4, 2021
Rollup merge of rust-lang#88361 - WaffleLapkin:patch-2, r=joshtriplett
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 cb835c8 + aba3608 commit bfdaab8

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
@@ -1104,11 +1104,11 @@ 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
1111+
/// [`fmt::Pointer`]: fmt::Pointer
11121112
///
11131113
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
11141114
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
@@ -1124,7 +1124,7 @@ mod prim_usize {}
11241124
/// The following traits are implemented on `&T` references if the underlying `T` also implements
11251125
/// that trait:
11261126
///
1127-
/// * All the traits in [`std::fmt`] except [`Pointer`] and [`fmt::Write`]
1127+
/// * All the traits in [`std::fmt`] except [`fmt::Pointer`] (which is implemented regardless of the type of its referent) and [`fmt::Write`]
11281128
/// * [`PartialOrd`]
11291129
/// * [`Ord`]
11301130
/// * [`PartialEq`]
@@ -1133,9 +1133,10 @@ mod prim_usize {}
11331133
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
11341134
/// * [`Hash`]
11351135
/// * [`ToSocketAddrs`]
1136+
/// * [`Send`] \(`&T` references also require <code>T: [Sync]</code>)
11361137
///
11371138
/// [`std::fmt`]: fmt
1138-
/// ['Pointer`]: fmt::Pointer
1139+
/// [`fmt::Pointer`]: fmt::Pointer
11391140
/// [`Hash`]: hash::Hash
11401141
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
11411142
///
@@ -1150,7 +1151,6 @@ mod prim_usize {}
11501151
/// * [`ExactSizeIterator`]
11511152
/// * [`FusedIterator`]
11521153
/// * [`TrustedLen`]
1153-
/// * [`Send`] \(note that `&T` references only get `Send` if <code>T: [Sync]</code>)
11541154
/// * [`io::Write`]
11551155
/// * [`Read`]
11561156
/// * [`Seek`]

0 commit comments

Comments
 (0)