Skip to content

Cleanup unneeded lints and drop unused Debug impls #3717

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
Jun 19, 2021

Conversation

jtgeibel
Copy link
Member

The lib crate is only used by other in-tree crates. Therefore if Debug
or Copy impls are ever needed, they can be easily added.

82 unused Debug impls are then dropped. This probably has a slight but
negligible improvement to compile/link times.

r? @Turbo87

@Turbo87
Copy link
Member

Turbo87 commented Jun 17, 2021

hmmm..... I like the first two commits of the PR, but I'm not sure about the third one that is dropping all of the existing Debug traits. They might not be used right now, but they make it slightly easier to debug while developing. Unless the build time improvement is significant I think I'd prefer to keep them 🤔

@pietroalbini any thoughts on this?

@Turbo87 Turbo87 added A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear labels Jun 17, 2021
@jtgeibel
Copy link
Member Author

@Turbo87 yeah I was a bit split on the final commit myself. I think it might be worth dropping the Debug impls and adding them back as they prove useful for debugging. I suspect a lot of these were added just to satisfy the lint. For example, I doubt the Debug impls on view structs is very useful, since the purpose of these is to implement Serialize for generating response data (which is already easily inspectable).

However, I definitely have no concern with dropping the 3rd commit either. I don't think it would be worth the effort to go through the list of structs to analyze them ahead of time, and would gladly drop the commit from this series if that is preferred.

@pietroalbini
Copy link
Member

Forced Debug is annoying when there are structs with fields that don't support Debug themselves, so I agree with removing the lint. I'd also check for manual impls of Debug that could be removed, I think I added a few of them myself.

jtgeibel added 2 commits June 19, 2021 09:07
The lib crate is only used by other in-tree crates. Therefore if Debug
or Copy impls are ever needed, they can be easily added.
@Turbo87
Copy link
Member

Turbo87 commented Jun 19, 2021

I've rebased and dropped the third commit for now (still available as jtgeibel@2c80e6b) :)

@bors r+

@bors
Copy link
Contributor

bors commented Jun 19, 2021

📌 Commit a891c24 has been approved by Turbo87

@bors
Copy link
Contributor

bors commented Jun 19, 2021

⌛ Testing commit a891c24 with merge 1168fd7...

@bors
Copy link
Contributor

bors commented Jun 19, 2021

☀️ Test successful - checks-actions
Approved by: Turbo87
Pushing 1168fd7 to master...

@bors bors merged commit 1168fd7 into rust-lang:master Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants