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

Automatically derive Clone and Debug #13

Open
kvark opened this issue Feb 13, 2018 · 1 comment
Open

Automatically derive Clone and Debug #13

kvark opened this issue Feb 13, 2018 · 1 comment

Comments

@kvark
Copy link
Contributor

kvark commented Feb 13, 2018

Currently, the implementations appear to be manually generated.

@Osspial
Copy link
Owner

Osspial commented Feb 14, 2018

This is intentional. Automatic derives are used in situations where they can be used, which is true of most structs. However, there are a couple cases where manual implementations are needed, because the underlying types don't directly implement the trait. The main case of this I can remember is implementing Derive on structs containing an array with a length greater than 32 - Derive isn't implemented on the array, so we have to convert the fields to slices before they can be printed, and that has to be done manually.

The custom Clone implementation was there to work around a compiler bug, with some types implementing Copy but not clone. That may be fixed by now, though, so I'll look into removing it.

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

2 participants