File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 77//! contain owned boxes or implement [`Drop`]), so the compiler considers
88//! them cheap and safe to copy. For other types copies must be made
99//! explicitly, by convention implementing the [`Clone`] trait and calling
10- //! the [`clone`][clone] method.
11- //!
12- //! [`Clone`]: trait.Clone.html
13- //! [clone]: trait.Clone.html#tymethod.clone
14- //! [`Drop`]: ../../std/ops/trait.Drop.html
10+ //! the [`Clone::clone`] method.
1511//!
1612//! Basic usage example:
1713//!
5147/// ## Derivable
5248///
5349/// This trait can be used with `#[derive]` if all fields are `Clone`. The `derive`d
54- /// implementation of [`clone`] calls [`clone`] on each field.
50+ /// implementation of [`Clone:: clone`] calls [`Clone:: clone`] on each field.
5551///
5652/// For a generic struct, `#[derive]` implements `Clone` conditionally by adding bound `Clone` on
5753/// generic parameters.
7470/// An example is a generic struct holding a function pointer. In this case, the
7571/// implementation of `Clone` cannot be `derive`d, but can be implemented as:
7672///
77- /// [`Copy`]: ../../std/marker/trait.Copy.html
78- /// [`clone`]: trait.Clone.html#tymethod.clone
79- ///
8073/// ```
8174/// struct Generate<T>(fn() -> T);
8275///
You can’t perform that action at this time.
0 commit comments