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

Lint explicit Clone implementations on Copy type #580

Merged
merged 1 commit into from
Jan 24, 2016

Conversation

mcarton
Copy link
Member

@mcarton mcarton commented Jan 24, 2016

@@ -6,7 +6,7 @@ A collection of lints to catch common mistakes and improve your Rust code.
[Jump to usage instructions](#usage)

##Lints
There are 97 lints included in this crate:
There are 98 lints included in this crate:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hype hype hype 💯

@llogiq
Copy link
Contributor

llogiq commented Jan 24, 2016

LGTM.

llogiq added a commit that referenced this pull request Jan 24, 2016
Lint explicit Clone implementations on Copy type
@llogiq llogiq merged commit 5f17b38 into rust-lang:master Jan 24, 2016
@mcarton mcarton deleted the derive branch January 24, 2016 14:53
@bluss
Copy link
Member

bluss commented Jan 31, 2016

Note that if the type is always Copy, an explicit clone impl is much more efficient, something like this one:

impl<T> Clone for Foo<T> {
    fn clone(&self) -> Self { *self }
}

This is faster to compile, and optimizes better.

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

Successfully merging this pull request may close these issues.

4 participants