Skip to content

Make all utils functions and structs crate-private and cleanup unused functions #2787

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 1 commit into from
Jun 21, 2021

Conversation

0xPoe
Copy link
Member

@0xPoe 0xPoe commented May 31, 2021

part of #2730
Because we use some methods in our tests, we need to set it to pub.

@0xPoe 0xPoe force-pushed the rustin-patch-utils-cleanup branch 3 times, most recently from c5bb3fb to 88ff3d7 Compare May 31, 2021 07:44
@0xPoe 0xPoe marked this pull request as ready for review May 31, 2021 08:13
@0xPoe
Copy link
Member Author

0xPoe commented Jun 8, 2021

@kinnison @rbtcollins Could you please take a look? Thanks!

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

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

For the most part I think this is fine - one query, and a quick check from @rbtcollins before this cleanup can go in.

I particularly like that you found what looks like some dead code.

@0xPoe 0xPoe force-pushed the rustin-patch-utils-cleanup branch from 88ff3d7 to 474fb0c Compare June 11, 2021 05:40
@0xPoe 0xPoe requested a review from kinnison June 11, 2021 05:42
Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

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

Looks plausible to me. @rbtcollins are you okay for this to merge?

@0xPoe
Copy link
Member Author

0xPoe commented Jun 15, 2021

Conflict resolved, @rbtcollins Could you please take a look?

@kinnison
Copy link
Contributor

Please don't merge into your branch, instead rebase onto master. If you need help with that, I can provide it.

@0xPoe 0xPoe force-pushed the rustin-patch-utils-cleanup branch from 490fa57 to 988f21c Compare June 15, 2021 08:17
@0xPoe
Copy link
Member Author

0xPoe commented Jun 15, 2021

Please don't merge into your branch, instead rebase onto master. If you need help with that, I can provide it.

Rebased!

@0xPoe 0xPoe requested a review from kinnison June 15, 2021 08:17
Copy link
Contributor

@rbtcollins rbtcollins 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 we need to introduce

#![deny(unreachable_pub)]

To all of our global lints - demo here, try turning it off and on

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=dd28683bfd53acd9b2d3bdc3c92db32e

@0xPoe
Copy link
Member Author

0xPoe commented Jun 20, 2021

I think we need to introduce

#![deny(unreachable_pub)]

To all of our global lints - demo here, try turning it off and on

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=dd28683bfd53acd9b2d3bdc3c92db32e

@rbtcollins I agree that we should introduce that lint, but should I open it after my current cleanup is done? Right now we have a few more modules of code that need to be modified. If we open it now, there will be a lot of code that needs to be changed that will be warned. Do you think it is acceptable for us to open it at the end? Because the cli module has a lot of code that needs to be changed and I will change it in my next PR.

@0xPoe 0xPoe requested a review from rbtcollins June 20, 2021 07:42
@0xPoe
Copy link
Member Author

0xPoe commented Jun 20, 2021

Added a to-do item to the issue.

@rbtcollins
Copy link
Contributor

rbtcollins commented Jun 20, 2021

I had another question on CommandError :)..

Re the lint: I think the lint is part of this bug; it doesn't have to be part of this PR - so it can certainly come in as another patch if it has a lot of dead code it picks up.

Oh - but heres an idea: you could be building the modules you touch with it, even if you don't commit the lint, you commit the results of the cleanup of the lint to the modules so each module is only touched once.

@0xPoe
Copy link
Member Author

0xPoe commented Jun 20, 2021

I had another question on CommandError :)..

Is this it? #2787 (comment) I should have replied to you?

Oh - but heres an idea: you could be building the modules you touch with it, even if you don't commit the lint, you commit the results of the cleanup of the lint to the modules so each module is only touched once.

Good idea, just tried it in the utils mod and no warnings were reported.

@rbtcollins
Copy link
Contributor

please squash the two commits together, then I think we merge this

@0xPoe 0xPoe force-pushed the rustin-patch-utils-cleanup branch from 988f21c to b9e2eb6 Compare June 21, 2021 01:19
@0xPoe
Copy link
Member Author

0xPoe commented Jun 21, 2021

please squash the two commits together, then I think we merge this

squashed! Thanks again for your review!

@rbtcollins rbtcollins merged commit 31a98d3 into rust-lang:master Jun 21, 2021
@0xPoe 0xPoe deleted the rustin-patch-utils-cleanup branch June 21, 2021 07:12
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.

3 participants