Skip to content

Commit

Permalink
Re-add explicit list of traits to tuple docs, with limit notes
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Jun 11, 2022
1 parent 090c68b commit 3fd1664
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 10 deletions.
39 changes: 34 additions & 5 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,40 @@ mod prim_str {}
///
/// # Trait implementations
///
/// In this documentation the shorthand `(T, ...)` is used to represent all
/// tuples up to length twelve. When that is used, any trait bounds expressed
/// on `T` applies to each field of the tuple independently. Note that this is
/// a convenience notation to avoid repetitive documentation, not valid
/// Rust syntax.
/// In this documentation the shorthand `(T, ...)` is used to represent tuples of varying length.
/// When that is used, any trait bounds expressed on `T` applies to each field of the tuple
/// independently. Note that this is a convenience notation to avoid repetitive documentation,
/// not valid Rust syntax.
///
/// Due to a temporary restriction in Rust’s type system, the following traits are only
/// implemented on tuples of arity 12 or less. In the future, this may change:
///
/// * [`PartialEq`]
/// * [`Eq`]
/// * [`PartialOrd`]
/// * [`Ord`]
/// * [`Debug`]
/// * [`Default`]
/// * [`Hash`]
///
/// [`Debug`]: fmt::Debug
/// [`Hash`]: hash::Hash
///
/// The following traits are implemented for tuples of any length. These traits have
/// implementations that are automatically generated by the compiler, so are not limited by
/// missing language features.
///
/// * [`Clone`]
/// * [`Copy`]
/// * [`Send`]
/// * [`Sync`]
/// * [`Unpin`]
/// * [`UnwindSafe`]
/// * [`RefUnwindSafe`]
///
/// [`Unpin`]: marker::Unpin
/// [`UnwindSafe`]: panic::UnwindSafe
/// [`RefUnwindSafe`]: panic::RefUnwindSafe
///
/// # Examples
///
Expand Down
39 changes: 34 additions & 5 deletions library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,40 @@ mod prim_str {}
///
/// # Trait implementations
///
/// In this documentation the shorthand `(T, ...)` is used to represent all
/// tuples up to length twelve. When that is used, any trait bounds expressed
/// on `T` applies to each field of the tuple independently. Note that this is
/// a convenience notation to avoid repetitive documentation, not valid
/// Rust syntax.
/// In this documentation the shorthand `(T, ...)` is used to represent tuples of varying length.
/// When that is used, any trait bounds expressed on `T` applies to each field of the tuple
/// independently. Note that this is a convenience notation to avoid repetitive documentation,
/// not valid Rust syntax.
///
/// Due to a temporary restriction in Rust’s type system, the following traits are only
/// implemented on tuples of arity 12 or less. In the future, this may change:
///
/// * [`PartialEq`]
/// * [`Eq`]
/// * [`PartialOrd`]
/// * [`Ord`]
/// * [`Debug`]
/// * [`Default`]
/// * [`Hash`]
///
/// [`Debug`]: fmt::Debug
/// [`Hash`]: hash::Hash
///
/// The following traits are implemented for tuples of any length. These traits have
/// implementations that are automatically generated by the compiler, so are not limited by
/// missing language features.
///
/// * [`Clone`]
/// * [`Copy`]
/// * [`Send`]
/// * [`Sync`]
/// * [`Unpin`]
/// * [`UnwindSafe`]
/// * [`RefUnwindSafe`]
///
/// [`Unpin`]: marker::Unpin
/// [`UnwindSafe`]: panic::UnwindSafe
/// [`RefUnwindSafe`]: panic::RefUnwindSafe
///
/// # Examples
///
Expand Down

0 comments on commit 3fd1664

Please sign in to comment.