Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl Copy for most primitive types explicitly #37295

Closed
liigo opened this issue Oct 20, 2016 · 5 comments
Closed

impl Copy for most primitive types explicitly #37295

liigo opened this issue Oct 20, 2016 · 5 comments

Comments

@liigo
Copy link
Contributor

liigo commented Oct 20, 2016

I can't think of any reason not to do this.

cc #37103

@liigo
Copy link
Contributor Author

liigo commented Oct 24, 2016

cc https://www.reddit.com/r/rust/comments/58yukd/if_rust_ensures_that_there_is_exactly_one_binding/
Some people are not aware that i32 implements Copy. Many answers on /r/rust said "i32 implements Copy", but it doesn't, at least not explicitly does.

@sinkuu
Copy link
Contributor

sinkuu commented Oct 24, 2016

Copy is a language built-in trait, so I guess it is automatically implemented for primitive types in the compiler. I don't understand rustc internals at all, but fn copy_conditions is a suspect:)

@liigo
Copy link
Contributor Author

liigo commented Oct 24, 2016

At docs level, make it clear that they implement Copy

  • in the language reference, or
  • in the std/core API reference

and, of cause, in the Book.

@ollie27
Copy link
Member

ollie27 commented Oct 24, 2016

I guess this is a duplicate of #25893.

@liigo
Copy link
Contributor Author

liigo commented Oct 25, 2016

closing as duplicate

@liigo liigo closed this as completed Oct 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants