1
Fork 0

Re-add explicit list of traits to tuple docs, with limit notes

This commit is contained in:
Michael Howell 2022-06-11 09:29:06 -07:00
parent 090c68ba5c
commit 3fd16648fe
2 changed files with 68 additions and 10 deletions

View file

@ -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 Rusts 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
///