Skip to content

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

Merged
merged 2 commits into from
Oct 3, 2021
Merged

exclude enum from derivable impls #7755

merged 2 commits into from
Oct 3, 2021

Conversation

HKalbasi
Copy link
Member

@HKalbasi HKalbasi commented Oct 3, 2021

fix #7753

changelog: Exclude enum from [`derivable_impls`]

@rust-highfive
Copy link

r? @flip1995

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 3, 2021
@@ -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();
Copy link
Member

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 🙃

@xFrednet
Copy link
Member

xFrednet commented Oct 3, 2021

Thanks! 🙃

@bors r+

@bors
Copy link
Contributor

bors commented Oct 3, 2021

📌 Commit 0ebc656 has been approved by xFrednet

@bors
Copy link
Contributor

bors commented Oct 3, 2021

⌛ Testing commit 0ebc656 with merge 3b0bfeb...

bors added a commit that referenced this pull request Oct 3, 2021
exclude enum from derivable impls

fix #7753

changelog:

Exclude enum from ``[`derivable_impls`]``
@bors
Copy link
Contributor

bors commented Oct 3, 2021

💔 Test failed - checks-action_test

@HKalbasi
Copy link
Member Author

HKalbasi commented Oct 3, 2021

If the problem was Enter after changlog, I deleted it.

@xFrednet
Copy link
Member

xFrednet commented Oct 3, 2021

Yes that it most likely the problem they have to be on the same line. I've updated the description 🙃

@bors retry

@bors
Copy link
Contributor

bors commented Oct 3, 2021

⌛ Testing commit 0ebc656 with merge 63b04f7...

@bors
Copy link
Contributor

bors commented Oct 3, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: xFrednet
Pushing 63b04f7 to master...

@bors bors merged commit 63b04f7 into rust-lang:master Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

derivable_impls wants derive(Default) on enum
5 participants