book icon indicating copy to clipboard operation
book copied to clipboard

Appendix C: Copy trait made seem like stack-only

Open AurumTheEnd opened this issue 3 years ago • 1 comments

  • [x] I have checked the latest main branch to see if this has already been fixed
  • [x] I have searched existing issues and pull requests for duplicates

URL to the section(s) of the book with this problem:

https://github.com/rust-lang/book/blob/main/src/appendix-03-derivable-traits.md

Description of the problem:

The chapter says the following regarding the Copy trait:

The Copy trait allows you to duplicate a value by only copying bits stored on the stack;

However, I think that the "on the stack" part is not anyhow reinforced: https://stackoverflow.com/questions/66770699/is-copy-trait-about-bit-copying-only-from-stack/66770829#66770829

Suggested fix:

The Copy trait allows you to duplicate a value by only copying bits of information;

AurumTheEnd avatar Oct 03 '22 14:10 AurumTheEnd

Pull request #3373 created on based of suggested changes.

VirenderNayal avatar Oct 03 '22 18:10 VirenderNayal

As noted on the PR: While Copy technically can be implemented in other contexts, it is really meant not to be. The original text here is correct. Thanks, though!

chriskrycho avatar Apr 24 '24 18:04 chriskrycho