docs(marker/copy): clarify that &T is also Copy

In the current documentation about the `Copy` marker trait, there is a section
about "additional implementors", which list additional implementors of the `Copy` trait.
The fact that shared references are also `Copy` is mixed with another point,
which makes it hard to recognize and make it seem not as important.

This clarifies the fact that shared references are also `Copy`, by mentioning it as a
separate item in the list of "additional implementors".
This commit is contained in:
Jan Riemer 2020-08-02 14:57:19 +02:00 committed by GitHub
parent 1e99138078
commit 7835c8c06c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -347,9 +347,8 @@ pub trait StructuralEq {
/// * Tuple types, if each component also implements `Copy` (e.g., `()`, `(i32, bool)`) /// * Tuple types, if each component also implements `Copy` (e.g., `()`, `(i32, bool)`)
/// * Closure types, if they capture no value from the environment /// * Closure types, if they capture no value from the environment
/// or if all such captured values implement `Copy` themselves. /// or if all such captured values implement `Copy` themselves.
/// Note that variables captured by shared reference always implement `Copy` /// * Variables captured by shared reference (e.g. `&T`) implement `Copy`, even if the referent (`T`) doesn't,
/// (even if the referent doesn't), /// while variables captured by mutable reference (e.g. `&mut T`) never implement `Copy`.
/// while variables captured by mutable reference never implement `Copy`.
/// ///
/// [`Vec<T>`]: ../../std/vec/struct.Vec.html /// [`Vec<T>`]: ../../std/vec/struct.Vec.html
/// [`String`]: ../../std/string/struct.String.html /// [`String`]: ../../std/string/struct.String.html