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

new_without_default: do not suggest deriving #5616

Merged
merged 1 commit into from
May 25, 2020

Conversation

euclio
Copy link
Contributor

@euclio euclio commented May 18, 2020


changelog: do not suggest deriving Default in new_without_default

This commit changes the behavior of the new_without_default lint to not suggest deriving Default. This suggestion is misleading if the new implementation does something different than what a derived Default implementation would do, because then the two methods would not be equivalent.

Instead, the can_derive_default check is removed, and we always suggest implementing Default in terms of new().

@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 19, 2020
@phansch phansch self-requested a review May 22, 2020 07:31
Copy link
Member

@phansch phansch left a comment

Choose a reason for hiding this comment

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

I think the lint description also needs to be updated:

https://github.com/euclio/rust-clippy/blob/no-derive-suggestion/clippy_lints/src/new_without_default.rs#L20

LGTM otherwise, thanks!

@phansch phansch added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels May 22, 2020
@flip1995 flip1995 added S-waiting-on-bors Status: The marked PR was approved and is only waiting bors and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels May 25, 2020
@flip1995
Copy link
Member

@bors r=phansch,flip1995

@bors
Copy link
Collaborator

bors commented May 25, 2020

📌 Commit a578bed has been approved by phansch,flip1995

@bors
Copy link
Collaborator

bors commented May 25, 2020

⌛ Testing commit a578bed with merge c41916d...

@bors
Copy link
Collaborator

bors commented May 25, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: phansch,flip1995
Pushing c41916d to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants