Uh oh!
There was an error while loading. Please reload this page.
rustc_metadata: Privatize more things and a couple of other refactorings - #66697
Conversation
Uh oh!
There was an error while loading. Please reload this page.
d2af54a to
f93c1e6Compareeddyb
commented
Nov 27, 2019
@bors r+ |
bors
commented
Nov 27, 2019
📌 Commit f93c1e6bb5074a95eefb12440ba88285e6ec7118 has been approved by |
bors
commented
Nov 28, 2019
☔ 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.
petrochenkov
commented
Nov 28, 2019
@bors r=eddyb |
bors
commented
Nov 28, 2019
📌 Commit e84c926 has been approved by |
bors
commented
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
bors
commented
Nov 29, 2019
☀️ Test successful - checks-azure |
rust-highfive
commented
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).
| pub fn injected_panic_runtime(self) -> Option<CrateNum> { | ||
| self.cstore.injected_panic_runtime() | ||
| } |
There was a problem hiding this comment.
Miri was relying on injected_panic_runtime... is there a replacement?
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().)
There was a problem hiding this comment.
That seems to work, thanks! (modulo some extra *)
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