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

Remember mutability in DefKind::Static. #95436

Merged
merged 1 commit into from
Mar 31, 2022
Merged

Conversation

cjgillot
Copy link
Contributor

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.

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.
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 29, 2022
@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 29, 2022
@@ -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)),
Copy link
Contributor Author

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.

@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 29, 2022
@bors
Copy link
Contributor

bors commented Mar 29, 2022

⌛ Trying commit 21a554c with merge 39fece7ca6b882c95674a74fbae0c129c9981acd...

@bors
Copy link
Contributor

bors commented Mar 29, 2022

☀️ Try build successful - checks-actions
Build commit: 39fece7ca6b882c95674a74fbae0c129c9981acd (39fece7ca6b882c95674a74fbae0c129c9981acd)

@rust-timer
Copy link
Collaborator

Queued 39fece7ca6b882c95674a74fbae0c129c9981acd with parent 05d2221, future comparison URL.

@rust-timer
Copy link
Collaborator

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
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 29, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Mar 30, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Mar 30, 2022

📌 Commit 21a554c has been approved by oli-obk

@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 Mar 30, 2022
@bors
Copy link
Contributor

bors commented Mar 30, 2022

⌛ Testing commit 21a554c with merge a40c595...

@bors
Copy link
Contributor

bors commented Mar 31, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing a40c595 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 31, 2022
@bors bors merged commit a40c595 into rust-lang:master Mar 31, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 31, 2022
@rust-timer
Copy link
Collaborator

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

@cjgillot cjgillot deleted the static-mut branch March 31, 2022 17:34
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 7, 2022
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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2022
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
dario23 added a commit to dario23/rust-semverver that referenced this pull request May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants