-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustc_metadata: Privatize more things #66496
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Nov 17, 2019
This was referenced Nov 17, 2019
This allows to privatize their fields.
petrochenkov
force-pushed
the
metapriv2
branch
from
November 17, 2019 17:11
00e4e1f
to
9dd9ae9
Compare
It allows to make most of its fields private
petrochenkov
force-pushed
the
metapriv2
branch
from
November 17, 2019 17:22
9dd9ae9
to
febde53
Compare
eddyb
approved these changes
Nov 17, 2019
@bors r+ |
📌 Commit febde53 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Nov 17, 2019
Centril
added a commit
to Centril/rust
that referenced
this pull request
Nov 20, 2019
rustc_metadata: Privatize more things Continuation of rust-lang#66056. The most notable change here is that `CrateMetadata` is moved from `cstore.rs` to `decoder.rs`. Most of uses of `CrateMetadata` fields are in the decoder and uses of `root: CrateRoot` and other fields are so intertwined with each other that it would be hard to move a part of them into `cstore.rs` to privatize `CrateMetadata` fields, so we are going the other way round. `cstore.rs` can probably be dismantled now, but I'll leave this to some other day. Similarly, remaining `CrateMetadata` fields can be privatized by introducing some getter/setter methods, but not today. r? @eddyb
bors
added a commit
that referenced
this pull request
Nov 20, 2019
Rollup of 7 pull requests Successful merges: - #66060 (Making ICEs and test them in incremental) - #66298 (rustdoc: fixes #64305: disable search field instead of hidding it) - #66457 (Just derive Hashstable in librustc) - #66496 (rustc_metadata: Privatize more things) - #66514 (Fix selected crate search filter) - #66535 (Avoid ICE when `break`ing to an unreachable label) - #66573 (Ignore run-make reproducible-build-2 on Mac) Failed merges: r? @ghost
bors
added a commit
that referenced
this pull request
Nov 29, 2019
rustc_metadata: Privatize more things and a couple of other refactorings This PR continues #66496 and hits the point of diminishing returns. All fields of `CrateRoot` and `CrateMetadata` are privatized. For read-only fields this certainly makes sense, but for a few fields updateable from outside of `rmeta.rs` (mostly `creader.rs`) it was done mostly for consistency, I can make them `pub(crate)` again if requested. `cstore.rs` (which became small after #66496) was merged into `creader.rs`. A few things noticed while making the privacy changes were addressed in the remaining refactoring commits. Fixes #66550 r? @eddyb @Mark-Simulacrum
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuation of #66056.
The most notable change here is that
CrateMetadata
is moved fromcstore.rs
todecoder.rs
.Most of uses of
CrateMetadata
fields are in the decoder and uses ofroot: CrateRoot
and other fields are so intertwined with each other that it would be hard to move a part of them intocstore.rs
to privatizeCrateMetadata
fields, so we are going the other way round.cstore.rs
can probably be dismantled now, but I'll leave this to some other day.Similarly, remaining
CrateMetadata
fields can be privatized by introducing some getter/setter methods, but not today.r? @eddyb