Skip to content

Document the traits that are #[derive]-able #29711

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

Closed
mackwic opened this issue Nov 9, 2015 · 5 comments
Closed

Document the traits that are #[derive]-able #29711

mackwic opened this issue Nov 9, 2015 · 5 comments

Comments

@mackwic
Copy link
Contributor

mackwic commented Nov 9, 2015

Hi Rust !

Neither on the reference nor the doc of the trait itself inform us of the derivability of the standard traits.

It would be great to have the list of all the derivable traits in the Reference, and each trait could have a note in its doc saying that this trait is automagically derivable.

Also, it could be worth pointing some of the issues with deriving in the doc.
A quick search showed me some lifetimes error in some special cases, and performance issue for large enums. This is something that could be in the doc of the traits with these known issues using auto-deriving.

@mackwic mackwic changed the title Document the trait that are #[derive]-able Document the traits that are #[derive]-able Nov 9, 2015
@apasel422
Copy link
Contributor

While it would be helpful to list them elsewhere, they are currently listed in the book: https://doc.rust-lang.org/nightly/book/traits.html#deriving.

@ebfull
Copy link
Contributor

ebfull commented Nov 9, 2015

Note that nothing appears to prevent that list from going out of date.

@nixpulvis
Copy link

However, deriving is limited to a certain set of traits [...]

This limitation would be nice to get away from as well. I'm not sure if this has been discussed elsewhere.

@apasel422
Copy link
Contributor

@steveklabnik
Copy link
Member

each trait could have a note in its doc saying that this trait is automagically derivable.

I think this is the right way to go to solve this issue, for sure. It's not in the reference because it's not really a language thing, and the restriction will go away eventually.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 16, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Nov 17, 2015
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

5 participants