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`)
This commit is contained in:
commit
97bd45b373
2 changed files with 6 additions and 10 deletions
|
@ -1104,11 +1104,10 @@ mod prim_usize {}
|
||||||
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
|
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
|
||||||
/// * [`Deref`]
|
/// * [`Deref`]
|
||||||
/// * [`Borrow`]
|
/// * [`Borrow`]
|
||||||
/// * [`Pointer`]
|
/// * [`fmt::Pointer`]
|
||||||
///
|
///
|
||||||
/// [`Deref`]: ops::Deref
|
/// [`Deref`]: ops::Deref
|
||||||
/// [`Borrow`]: borrow::Borrow
|
/// [`Borrow`]: borrow::Borrow
|
||||||
/// [`Pointer`]: fmt::Pointer
|
|
||||||
///
|
///
|
||||||
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
|
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
|
||||||
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
|
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
|
||||||
|
@ -1124,7 +1123,7 @@ mod prim_usize {}
|
||||||
/// The following traits are implemented on `&T` references if the underlying `T` also implements
|
/// The following traits are implemented on `&T` references if the underlying `T` also implements
|
||||||
/// that trait:
|
/// that trait:
|
||||||
///
|
///
|
||||||
/// * All the traits in [`std::fmt`] except [`Pointer`] and [`fmt::Write`]
|
/// * All the traits in [`std::fmt`] except [`fmt::Pointer`] (which is implemented regardless of the type of its referent) and [`fmt::Write`]
|
||||||
/// * [`PartialOrd`]
|
/// * [`PartialOrd`]
|
||||||
/// * [`Ord`]
|
/// * [`Ord`]
|
||||||
/// * [`PartialEq`]
|
/// * [`PartialEq`]
|
||||||
|
@ -1133,9 +1132,9 @@ mod prim_usize {}
|
||||||
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
|
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
|
||||||
/// * [`Hash`]
|
/// * [`Hash`]
|
||||||
/// * [`ToSocketAddrs`]
|
/// * [`ToSocketAddrs`]
|
||||||
|
/// * [`Send`] \(`&T` references also require <code>T: [Sync]</code>)
|
||||||
///
|
///
|
||||||
/// [`std::fmt`]: fmt
|
/// [`std::fmt`]: fmt
|
||||||
/// ['Pointer`]: fmt::Pointer
|
|
||||||
/// [`Hash`]: hash::Hash
|
/// [`Hash`]: hash::Hash
|
||||||
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
|
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
|
||||||
///
|
///
|
||||||
|
@ -1150,7 +1149,6 @@ mod prim_usize {}
|
||||||
/// * [`ExactSizeIterator`]
|
/// * [`ExactSizeIterator`]
|
||||||
/// * [`FusedIterator`]
|
/// * [`FusedIterator`]
|
||||||
/// * [`TrustedLen`]
|
/// * [`TrustedLen`]
|
||||||
/// * [`Send`] \(note that `&T` references only get `Send` if <code>T: [Sync]</code>)
|
|
||||||
/// * [`io::Write`]
|
/// * [`io::Write`]
|
||||||
/// * [`Read`]
|
/// * [`Read`]
|
||||||
/// * [`Seek`]
|
/// * [`Seek`]
|
||||||
|
|
|
@ -1104,11 +1104,10 @@ mod prim_usize {}
|
||||||
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
|
/// * [`Clone`] \(Note that this will not defer to `T`'s `Clone` implementation if it exists!)
|
||||||
/// * [`Deref`]
|
/// * [`Deref`]
|
||||||
/// * [`Borrow`]
|
/// * [`Borrow`]
|
||||||
/// * [`Pointer`]
|
/// * [`fmt::Pointer`]
|
||||||
///
|
///
|
||||||
/// [`Deref`]: ops::Deref
|
/// [`Deref`]: ops::Deref
|
||||||
/// [`Borrow`]: borrow::Borrow
|
/// [`Borrow`]: borrow::Borrow
|
||||||
/// [`Pointer`]: fmt::Pointer
|
|
||||||
///
|
///
|
||||||
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
|
/// `&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating
|
||||||
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
|
/// multiple simultaneous mutable borrows), plus the following, regardless of the type of its
|
||||||
|
@ -1124,7 +1123,7 @@ mod prim_usize {}
|
||||||
/// The following traits are implemented on `&T` references if the underlying `T` also implements
|
/// The following traits are implemented on `&T` references if the underlying `T` also implements
|
||||||
/// that trait:
|
/// that trait:
|
||||||
///
|
///
|
||||||
/// * All the traits in [`std::fmt`] except [`Pointer`] and [`fmt::Write`]
|
/// * All the traits in [`std::fmt`] except [`fmt::Pointer`] (which is implemented regardless of the type of its referent) and [`fmt::Write`]
|
||||||
/// * [`PartialOrd`]
|
/// * [`PartialOrd`]
|
||||||
/// * [`Ord`]
|
/// * [`Ord`]
|
||||||
/// * [`PartialEq`]
|
/// * [`PartialEq`]
|
||||||
|
@ -1133,9 +1132,9 @@ mod prim_usize {}
|
||||||
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
|
/// * [`Fn`] \(in addition, `&T` references get [`FnMut`] and [`FnOnce`] if `T: Fn`)
|
||||||
/// * [`Hash`]
|
/// * [`Hash`]
|
||||||
/// * [`ToSocketAddrs`]
|
/// * [`ToSocketAddrs`]
|
||||||
|
/// * [`Send`] \(`&T` references also require <code>T: [Sync]</code>)
|
||||||
///
|
///
|
||||||
/// [`std::fmt`]: fmt
|
/// [`std::fmt`]: fmt
|
||||||
/// ['Pointer`]: fmt::Pointer
|
|
||||||
/// [`Hash`]: hash::Hash
|
/// [`Hash`]: hash::Hash
|
||||||
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
|
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
|
||||||
///
|
///
|
||||||
|
@ -1150,7 +1149,6 @@ mod prim_usize {}
|
||||||
/// * [`ExactSizeIterator`]
|
/// * [`ExactSizeIterator`]
|
||||||
/// * [`FusedIterator`]
|
/// * [`FusedIterator`]
|
||||||
/// * [`TrustedLen`]
|
/// * [`TrustedLen`]
|
||||||
/// * [`Send`] \(note that `&T` references only get `Send` if <code>T: [Sync]</code>)
|
|
||||||
/// * [`io::Write`]
|
/// * [`io::Write`]
|
||||||
/// * [`Read`]
|
/// * [`Read`]
|
||||||
/// * [`Seek`]
|
/// * [`Seek`]
|
||||||
|
|
Loading…
Reference in a new issue