-
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
Remember mutability in DefKind::Static
.
#95436
Conversation
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -1737,7 +1738,7 @@ impl Disambiguator { | |||
"union" => Kind(DefKind::Union), | |||
"module" | "mod" => Kind(DefKind::Mod), | |||
"const" | "constant" => Kind(DefKind::Const), | |||
"static" => Kind(DefKind::Static), | |||
"static" => Kind(DefKind::Static(Mutability::Not)), |
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.
We don't have enough information to recover the proper DefKind
, however I don't think this Mutability
is actually used anywhere.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 21a554c with merge 39fece7ca6b882c95674a74fbae0c129c9981acd... |
☀️ Try build successful - checks-actions |
Queued 39fece7ca6b882c95674a74fbae0c129c9981acd with parent 05d2221, future comparison URL. |
Finished benchmarking commit (39fece7ca6b882c95674a74fbae0c129c9981acd): comparison url. Summary: This benchmark run did not return any relevant results. 26 results were found to be statistically significant but too small to be relevant. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
@bors r+ |
📌 Commit 21a554c has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a40c595): comparison url. Summary: This benchmark run did not return any relevant results. 16 results were found to be statistically significant but too small to be relevant. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Remember mutability in `DefKind::Static`. This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
Avoid accessing HIR from MIR passes `hir_owner_nodes` contains a lot of information, and the query result is typically dirty. This forces dependent queries to be re-executed needlessly. This PR refactors some accesses to HIR to go through more targeted queries that yield the same result. Based on rust-lang#95435 and rust-lang#95436
This allows to compute the
BodyOwnerKind
fromDefKind
only, andremoves a direct dependency of some MIR queries onto HIR.
As a side effect, it also simplifies metadata, since we don't need 4
flavours of
EntryKind::*Static
any more.