rustc_metadata: Privatize more things and a couple of other refactorings#66697
Merged
bors merged 13 commits intorust-lang:masterfrom Nov 29, 2019
Merged
rustc_metadata: Privatize more things and a couple of other refactorings#66697bors merged 13 commits intorust-lang:masterfrom
bors merged 13 commits intorust-lang:masterfrom
Conversation
bjorn3
reviewed
Nov 24, 2019
d2af54a to
f93c1e6
Compare
eddyb
approved these changes
Nov 27, 2019
Member
|
@bors r+ |
Collaborator
|
📌 Commit f93c1e6bb5074a95eefb12440ba88285e6ec7118 has been approved by |
Collaborator
|
☔ The latest upstream changes (presumably #66824) made this pull request unmergeable. Please resolve the merge conflicts. |
All of them are read-only
After it's moved to `creader.rs`
…lution Namely, `update_extern_crate`. Also, stop tracking visited crates in `update_extern_crate`, the rank check does the same thing (prevents visiting dependencies if the rank didn't change), but more precisely.
f93c1e6 to
e84c926
Compare
Contributor
Author
|
@bors r=eddyb |
Collaborator
|
📌 Commit e84c926 has been approved by |
Collaborator
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
Collaborator
|
☀️ Test successful - checks-azure |
Contributor
rust-highfive
added a commit
to rust-lang-nursery/rust-toolstate
that referenced
this pull request
Nov 29, 2019
Tested on commit rust-lang/rust@d99e0c6. Direct link to PR: <rust-lang/rust#66697> 💔 miri on windows: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung, @rust-lang/infra). 💔 miri on linux: test-fail → build-fail (cc @oli-obk @eddyb @RalfJung, @rust-lang/infra).
RalfJung
reviewed
Nov 29, 2019
|
|
||
| pub fn injected_panic_runtime(self) -> Option<CrateNum> { | ||
| self.cstore.injected_panic_runtime() | ||
| } |
Member
There was a problem hiding this comment.
Miri was relying on injected_panic_runtime... is there a replacement?
Contributor
Author
There was a problem hiding this comment.
Hmm, something like
tcx.crates().iter().find(|cnum| tcx.is_panic_runtime(cnum))should work without re-exposing things privatized in this PR.
(If that's not ok, I can send a PR re-adding tcx.injected_panic_runtime().)
Member
There was a problem hiding this comment.
That seems to work, thanks! (modulo some extra *)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR continues #66496 and hits the point of diminishing returns.
All fields of
CrateRootandCrateMetadataare privatized.For read-only fields this certainly makes sense, but for a few fields updateable from outside of
rmeta.rs(mostlycreader.rs) it was done mostly for consistency, I can make thempub(crate)again if requested.cstore.rs(which became small after #66496) was merged intocreader.rs.A few things noticed while making the privacy changes were addressed in the remaining refactoring commits.
Fixes #66550
r? @eddyb @Mark-Simulacrum