File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -288,8 +288,18 @@ marker_impls! {
288288/// }
289289/// ```
290290///
291- /// There is a small difference between the two: the `derive` strategy will also place a `Copy`
292- /// bound on type parameters, which isn't always desired.
291+ /// There is a small difference between the two. The `derive` strategy will also place a `Copy`
292+ /// bound on type parameters:
293+ ///
294+ /// ```
295+ /// struct MyStruct<T>;
296+ ///
297+ /// impl<T: Copy> Copy for MyStruct<T> { }
298+ /// ```
299+ ///
300+ /// This isn't always desired. For example, shared references (`&T`) can be copied regardless of
301+ /// whether `T` is `Copy`. Likewise, a generic struct containing markers such as [`PhantomData`]
302+ /// could potentially be duplicated with a bit-wise copy.
293303///
294304/// ## What's the difference between `Copy` and `Clone`?
295305///
You can’t perform that action at this time.
0 commit comments