-
Notifications
You must be signed in to change notification settings - Fork 1.6k
exclude enum from derivable impls #7755
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
Conversation
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
clippy_lints/src/derivable_impls.rs
Outdated
@@ -83,6 +83,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls { | |||
if !attrs.iter().any(|attr| attr.doc_str().is_some()); | |||
if let child_attrs = cx.tcx.hir().attrs(impl_item_hir); | |||
if !child_attrs.iter().any(|attr| attr.doc_str().is_some()); | |||
if !adt_def.is_enum(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should check for if adt_def.is_struct();
instead, to make sure that we don't get any FPs on unions, as they can also not derive Default
. Otherwise, this looks good to me 🙃
Thanks! 🙃 @bors r+ |
📌 Commit 0ebc656 has been approved by |
exclude enum from derivable impls fix #7753 changelog: Exclude enum from ``[`derivable_impls`]``
💔 Test failed - checks-action_test |
If the problem was Enter after changlog, I deleted it. |
Yes that it most likely the problem they have to be on the same line. I've updated the description 🙃 @bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fix #7753
changelog: Exclude enum from
[`derivable_impls`]