about summary refs log tree commit diff
path: root/src/test/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-06-16 13:31:06 +0900
committerGitHub <noreply@github.com>2021-06-16 13:31:06 +0900
commit7ceb706e9d9a6c3a19c3a340705fe4ac1c343d02 (patch)
tree4b022663c814a0b05f6cafadff4d6f7710abcfb4 /src/test/debuginfo/enum-thinlto.rs
parent163dbda22bb70d9ed05147b85670cc13dcf906f3 (diff)
parent2788c71dd44f0badd88a8a9971b5ce23e95905b7 (diff)
downloadrust-7ceb706e9d9a6c3a19c3a340705fe4ac1c343d02.tar.gz
rust-7ceb706e9d9a6c3a19c3a340705fe4ac1c343d02.zip
Rollup merge of #86200 - qwerty01:clone-doc-update, r=JohnTitor
Updates `Clone` docs for `Copy` comparison.

Quite a few people (myself included) have come under the impression that the difference between `Copy` and `Clone` is that `Copy` is cheap and `Clone` is expensive, where the actual difference is that `Copy` constrains the type to bit-wise copying, and `Clone` allows for more expensive operations. The source of this misconception is in the `Clone` docs, where the following line is in the description:

> Differs from `Copy` in that `Copy` is implicit and extremely inexpensive, while `Clone` is always explicit and may or may not be expensive.

The `Clone` documentation page also comes up before the `Copy` page on google when searching for "the difference between `Clone` and `Copy`".

This PR updates the documentation to clarify that "extremely inexpensive" means an "inexpensive bit-wise copy" to hopefully prevent future rust users from falling into this misunderstanding.
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions