Skip to content
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

Use HashStable_Generic in rustc_type_ir #101549

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

eholk
Copy link
Contributor

@eholk eholk commented Sep 7, 2022

A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require I: Interner + HashStable.

r? @cjgillot

A lot of the types in this crate implemented HashStable directly to
avoid circular dependencies. One way around that is to use
HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require
`I: Interner + HashStable`.
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 7, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 7, 2022
@jackh726
Copy link
Member

jackh726 commented Sep 8, 2022

r? @jackh726

@bors r+

@bors
Copy link
Contributor

bors commented Sep 8, 2022

📌 Commit 578fc49 has been approved by jackh726

It is now in the queue for this repository.

@rust-highfive rust-highfive assigned jackh726 and unassigned cjgillot Sep 8, 2022
@bors 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 Sep 8, 2022
@@ -21,6 +21,7 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_type_ir = { path = "../rustc_type_ir" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this bad? It adds a new dependency edge that might make the critical path longer (since query_system AFAIK is a very slow crate).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could move the HashStableContext trait to a higher level crate (like whatever one defines HashStable_Generic) and do a use HashStableContext at the root? It seems like if this is going to be a common pattern where we need these marker traits for anyone who is going to use HashStable_Generic, it'd be nice to use the same one if possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I don't think it's so straightforward whether this will regression compile times, since many of the other dependencies of rustc_query_system are not dependencies of rustc_type_ir.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 8, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#101153 (Migrate another part of rustc_infer to session diagnostic)
 - rust-lang#101399 (Shrink span for bindings with subpatterns.)
 - rust-lang#101422 (Hermit: Add File::set_time stub)
 - rust-lang#101455 (Avoid UB in the Windows filesystem code in... bootstrap?)
 - rust-lang#101498 (rustc: Parameterize `ty::Visibility` over used ID)
 - rust-lang#101549 (Use HashStable_Generic in rustc_type_ir)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7f46d73 into rust-lang:master Sep 8, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 8, 2022
@reza-ebrahimi
Copy link

This PR is merged without the reviewer's approval, Am I wrong?

cc @RalfJung @cjgillot

@cjgillot
Copy link
Contributor

cjgillot commented Sep 8, 2022

@jackh726 took the review, approved it, and I don't mind. Everything is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants