-
Notifications
You must be signed in to change notification settings - Fork 13k
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 private code and remove dead code #65170
Conversation
Ping from triage thank you |
src/librustc_resolve/lib.rs
Outdated
@@ -1183,7 +1182,7 @@ impl<'a> Resolver<'a> { | |||
vis: ty::Visibility::Public, | |||
}), | |||
|
|||
crate_loader, | |||
crate_loader: CrateLoader::new(session, cstore, crate_name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this.
CrateLoader
is an "immutable reference" to some fields in rustc_interface::Compiler
plus the result of rustc_interface
query crate_name()
.
(metadata_loader
should also migrate from CStore
to CrateLoader
and it's also a kind of "immutable reference" to rustc_interface::Compiler
.)
CrateLoader::new
is called from multiple places right now, but it should always return the same thing.
I'll probably try to add a rustc_interface
query for it.
I want to split the crate locator configuration (locator::Context
) into three parts - immutable per-session configuration, immutable per-search configuration, and mutable output / in-progress state.
CrateLoader
is supposed to be the "immutable per-session configuration" in this case, that's why I want to make sure that it's indeed the same all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted this bit, CrateLoader
is now constructed in the same place as before.
I'll try to do something with it later.
I've added a couple more commits. cc @michaelwoerister, perhaps you can review this if @eddyb is unavailable? |
☔ The latest upstream changes (presumably #65240) made this pull request unmergeable. Please resolve the merge conflicts. |
@petrochenkov I put it on my todo list. |
Was there another PR with a similar title? For some reason I thought I reviewed this. |
Yeah, probably the previous one - #65026. |
Use a more traditional scheme with providing them as a resolver output
r=me after rebase. |
@bors r=eddyb |
📌 Commit f5baad2 has been approved by |
⌛ Testing commit f5baad2 with merge db0b0c5143f9ccecc648b233f781e4c644678b28... |
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
@bors retry azure network error |
rustc_metadata: Privatize private code and remove dead code Also some minor cleanup and documentation improvements. r? @eddyb
⌛ Testing commit f5baad2 with merge 592927c191719918d0781e47e5355d7c538739a8... |
@bors retry rolled up |
Rollup of 10 pull requests Successful merges: - #65170 (rustc_metadata: Privatize private code and remove dead code) - #65260 (Optimize `LexicalResolve::expansion`.) - #65261 (Remove `Option` from `TokenStream`) - #65332 (std::fmt: reorder docs) - #65340 (Several changes to the codegen backend organization) - #65365 (Include const generic arguments in metadata) - #65398 (Bring attention to suggestions when the only difference is capitalization) - #65410 (syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`) - #65415 (Remove an outdated test output file) - #65416 (Minor sync changes) Failed merges: r? @ghost
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Also some minor cleanup and documentation improvements.
r? @eddyb