diff options
| author | Jan Riemer <janriemer@users.noreply.github.com> | 2020-08-16 20:03:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-16 20:03:34 +0200 |
| commit | a876b3d8aaf21510e569ce62dfc6c50a3cf3efd3 (patch) | |
| tree | a4613f1779c282298f3659ccd205211aaa90424b /src/test/codegen/src-hash-algorithm | |
| parent | 7835c8c06cc80b5a0d3d08c1ab1b91240a8aec52 (diff) | |
| download | rust-a876b3d8aaf21510e569ce62dfc6c50a3cf3efd3.tar.gz rust-a876b3d8aaf21510e569ce62dfc6c50a3cf3efd3.zip | |
docs(marker/copy): provide example for `&T` being `Copy`
In the current documentation about the `Copy` marker trait, there is a section with examples of structs that can implement `Copy`. Currently there is no example for showing that shared references (`&T`) are also `Copy`. It is worth to have a dedicated example for `&T` being `Copy`, because shared references are an integral part of the language and it being `Copy` is not as intuitive as other types that share this behaviour like `i32` or `bool`. The example picks up on the previous non-`Copy` struct and shows that structs can be `Copy`, even when they hold a shared reference to a non-`Copy` type.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
