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

Emitting or deriving trait implementations #886

Open
7 of 11 tasks
fitzgen opened this issue Aug 1, 2017 · 5 comments
Open
7 of 11 tasks

Emitting or deriving trait implementations #886

fitzgen opened this issue Aug 1, 2017 · 5 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Aug 1, 2017

Let's implement all the traits!!

All of the "Derive Blah when possible" issues have code in tree already that they can crib from, so shouldn't be too difficult to write.

Once we start deriving lots of different traits, I expect we may find that we can unify their implementations, or at least make a generic CanDeriveTrait<T: DerivableTrait> kind of generic thing.


@dimbleby
Copy link
Contributor

Should Copy be included in this meta-issue (as discussed in #934)? It would be a real odd-man-out if not.

@fitzgen
Copy link
Member Author

fitzgen commented Sep 18, 2017

Should Copy be included in this meta-issue (as discussed in #934)? It would be a real odd-man-out if not.

We already derive/impl Clone and Copy when possible, it's just that there's that caveat discussed in #934. This meta issue is for tracking traits we don't derive/impl yet.

@photoszzt
Copy link
Contributor

photoszzt commented Sep 18, 2017

@fitzgen derive Hash(#876) is implemented. But miss the mark there.

@fitzgen
Copy link
Member Author

fitzgen commented Sep 18, 2017

@fitzgen derive Hash(#876) is implemented. But miss the mark there.

Fixed, thanks!

@dimbleby
Copy link
Contributor

dimbleby commented Sep 18, 2017

We already derive/impl Clone and Copy when possible, it's just that there's that caveat discussed in #934. This meta issue is for tracking traits we don't derive/impl yet.

My point is that #934 says that WIBNI to derive Clone where possible and (only) otherwise manually implement it; and that this issue says pretty much the same thing for every other trait. In particular, bindgen often does not derive Clone when it would have been possible to do so.

But I don't suppose it really matters! Tracking that in one place is certainly enough; I was just trying to tie some loose ends together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants