Uh oh!
There was an error while loading. Please reload this page.
librustc_*: Use pub(crate) instead of pub and remove dead code - #43192
librustc_*: Use pub(crate) instead of pub and remove dead code#43192petrochenkov wants to merge 6 commits into
pub(crate) instead of pub and remove dead code#43192Conversation
rust-highfive
commented
Jul 12, 2017
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Just use :vis to combine all 3 arms here?
There was a problem hiding this comment.
Ugh, it requires #![feature(macro_vis_matcher)] in all crates where the macro containing it is used, including tests.
pub(crate) instead of pub and remove dead codepub(crate) instead of pub and remove dead codeThere was a problem hiding this comment.
Any chance a bunch of these are used on only some host OSes?
There was a problem hiding this comment.
Looks like no, but CI should catch if I missed anything.
mcarton
commented
Jul 12, 2017
We'd be lucky if something like that does not break Clippy. Cc @Manishearth, @llogiq, @oli-obk |
oli-obk
commented
Jul 13, 2017
This is great! Would you be so kind and also test whether clippy and miri keep building and adjust your PR accordingly? |
michaelwoerister
left a comment
There was a problem hiding this comment.
I did a pass over rustc_data_structures.
There was a problem hiding this comment.
I think it makes sense to keep this type publicly available.
There was a problem hiding this comment.
This still seems like a useful type to have.
oli-obk
commented
Jul 14, 2017
Thanks! |
265ae78 to
55694caComparepetrochenkov
commented
Jul 14, 2017
Updated, comments addresses. |
There was a problem hiding this comment.
is_unsafe being unused looks like a bug. It should be used in expansion, but it's ignored and all methods are expanded as unsafe.
@alexcrichton, is this intentional or just an omission?
There was a problem hiding this comment.
Ah yes historically used but no longer used! Should be safe to remove.
9b1c051 to
9153114Comparenikomatsakis
commented
Jul 17, 2017
I think these changes look good. I am sad to see some of the code go (e.g., useful algorithms on graphs etc), but I think that it's best to kill dead code. Those bits are still around in the git history if we ever want them. (In any case, I suspect we should start moving the |
alexcrichton
commented
Jul 20, 2017
ping r? @eddyb |
There was a problem hiding this comment.
Was the generator for these updated?
There was a problem hiding this comment.
Updated in the latest commit.
There was a problem hiding this comment.
Is this correct? Seems a mistake.
There was a problem hiding this comment.
Ha, I fixed several similar cases, but haven't seen this one.
I grepped a bit harder and found a few more, fixed in the last commit.
There was a problem hiding this comment.
Is this file some sort of rebase failure?
eddyb
left a comment
There was a problem hiding this comment.
Went through the entire diff and left some comments. Not that worried about deletions, because of git history, but some of the changes seemed unintentional.
There was a problem hiding this comment.
These Data structures should all be pub still, they are expected to be used by clients
There was a problem hiding this comment.
LIkewsie this trait and the functions below are API and should still be public
There was a problem hiding this comment.
All these changes from here on down are bogus and should still be pub.
There was a problem hiding this comment.
pretty much everything here should be pub
There was a problem hiding this comment.
where 'here' = all of the _errors crate
There was a problem hiding this comment.
I made all the interface of Diagnostic public, but kept stuff in other modules containing implementation details crate-private.
nrc
commented
Jul 20, 2017
I think that any change from pub -> pub(crate) in a non-public module is just noise (both in the git history and the source code). I think I'm generally a bit sad about how much noisier this is making the code, even if the tighter encapsulation and dead code removal have benefits. |
bors
commented
Jul 21, 2017
☔ The latest upstream changes (presumably #43183) made this pull request unmergeable. Please resolve the merge conflicts. |
Revert some `pub(crate)`s to `pub`s to make sure Miri and Clippy work Revert some `pub(crate)`s to `pub`s to address Michael Woerister's comments
petrochenkov
commented
Jul 21, 2017
Rebased, comments addressed. |
petrochenkov
commented
Jul 21, 2017
Interesting, this was kinda the point for me. |
pub(crate) instead of pub and remove dead codepub(crate) instead of pub and remove dead codebors
commented
Jul 23, 2017
☔ The latest upstream changes (presumably #43387) made this pull request unmergeable. Please resolve the merge conflicts. |
nrc
commented
Jul 24, 2017
This is pretty much a weakness in Rust's privacy system (and one the lang team has been debating recently). Does the privacy annotation on an item mean that item is 'at most' this public or 'at least' this public? Using Given that this is only helpful for crate-level encapsulation and it is so noisey, I'd prefer not to do it. |
At least with |
petrochenkov
commented
Jul 25, 2017
The primary benefit from |
This probably needs some collective decision from people working on these crates.
|
nrc
commented
Jul 26, 2017
I think the dead code removal is certainly worth landing. I would prefer not to land the rest, however, I don't work much on the crates which are mostly affected so if others want the changes, I won't object. |
petrochenkov
commented
Jul 26, 2017
This annoys me too, btw. |
aidanhs
commented
Aug 3, 2017
@petrochenkov looks like this needs a rebase!
Who are you referring to here? i.e. is this with a rust team to come to a decision? |
@aidanhs @rfcbot fcp merge Questions:
|
eddyb
commented
Aug 3, 2017
@rfcbot fcp merge |
Team member @eddyb has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
petrochenkov
commented
Aug 19, 2017
Too much bit rot and not enough interest, closing. |
This PR does the next things:
pubs inlibrustc*crates (except forlibrustcitself) withpub(crate)s.x.py testfrom passing and RLS/Miri/Clippy from building.The changes are 99% mechanical. I didn't judge and (semi-automatically) removed everything the compiler told me. Now this needs to be reviewed and some false positives need to be reverted (either for interface completeness or because they are needed by some third party tools).
EDIT: Changes mentioned in review comments are reverted.
cc @nikomatsakis and @michaelwoerister for
rustc_data_structurescc @nrc for
librustc_driverAPIs and toolscc @rust-lang/compiler for everything else, if you see something that should be kept please leave a comment!
Next steps after reviewing:
pub(crate)with nothing in crate roots.