-
Notifications
You must be signed in to change notification settings - Fork 769
Closed
Labels
Description
bindgen almost always implements Clone explicitly, like this:
impl Clone for Foo {
fn clone(&self) -> Self { *self }
}I (accidentally!) ran clippy over some autogenerated code and it expressed disappointment that Clone was manually implemented for all sorts of structures on which Copy was derived:
warning: you are implementing `Clone` explicitly on a `Copy` type
And indeed, Clone could be derived in every case, at least for my project.
The code that prevents this is here.
My input header is a plain C header (so certainly no templates). If anything, it almost looks as though that test is exactly backwards, though I expect it's more likely that I simply don't understand what issue is being avoided here...
Anyway, it certainly seems like Clone could be derived a lot more often than it currently is.