book
book copied to clipboard
Appendix C: Copy trait made seem like stack-only
- [x] I have checked the latest
mainbranch 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;
Pull request #3373 created on based of suggested changes.
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!