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

Handle rustc_hir_analysis cases of potential_query_instability lint #131140

Conversation

ismailarilik
Copy link
Contributor

@ismailarilik ismailarilik commented Oct 2, 2024

This PR removes #![allow(rustc::potential_query_instability)] line from compiler/rustc_hir_analysis/src/lib.rs and converts FxHash{Map,Set} types into FxIndex{Map,Set} to suppress lint errors.

A somewhat tracking issue: #84447

@rustbot
Copy link
Collaborator

rustbot commented Oct 2, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jieyouxu (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 2, 2024
@ismailarilik ismailarilik changed the title Handle rustc-hir-analysis cases of potential_query_instability lint Handle rustc_hir_analysis cases of potential_query_instability lint Oct 2, 2024
@ismailarilik ismailarilik marked this pull request as ready for review October 2, 2024 06:42
@rustbot
Copy link
Collaborator

rustbot commented Oct 2, 2024

HIR ty lowering was modified

cc @fmease

@jieyouxu
Copy link
Member

jieyouxu commented Oct 2, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Oct 2, 2024

⌛ Trying commit 807e812 with merge 459d927...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 2, 2024
…instability-lint-for-rustc-hir-analysis, r=<try>

Handle `rustc_hir_analysis` cases of `potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_hir_analysis/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_analysis/src/lib.rs#L61) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: rust-lang#84447
@bors
Copy link
Contributor

bors commented Oct 2, 2024

☀️ Try build successful - checks-actions
Build commit: 459d927 (459d927b7f6c2513923e975f6b861e1a9a478cd0)

@rust-timer

This comment has been minimized.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

These look good, and I doubt they will cause perf issues. I think I may have introduced those GAT usages of hashmaps lol.

@compiler-errors
Copy link
Member

r=me (in rust parlance, i will approve) after the perf run comes back.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (459d927): comparison URL.

Overall result: ✅ improvements - no action needed

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 may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 3
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.1%, secondary -1.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.1% [1.0%, 1.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) 1.1% [1.0%, 1.2%] 2

Cycles

Results (secondary 2.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
8.2% [8.2%, 8.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 772.38s -> 770.477s (-0.25%)
Artifact size: 341.55 MiB -> 341.50 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 2, 2024
@jieyouxu jieyouxu assigned compiler-errors and unassigned jieyouxu Oct 2, 2024
@compiler-errors
Copy link
Member

👍
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 2, 2024

📌 Commit 807e812 has been approved by compiler-errors

It is now in the queue for this repository.

@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 Oct 2, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 2, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#130863 (Relax a debug assertion for dyn principal *equality* in codegen)
 - rust-lang#131016 (Apple: Do not specify an SDK version in `rlib` object files)
 - rust-lang#131140 (Handle `rustc_hir_analysis` cases of `potential_query_instability` lint)
 - rust-lang#131141 (mpmc doctest: make sure main thread waits for child threads)
 - rust-lang#131150 (only query `params_in_repr` if def kind is adt)
 - rust-lang#131151 (Replace zero-width whitespace with a visible `\` in the PR template)
 - rust-lang#131152 (Improve const traits diagnostics for new desugaring)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7e0797c into rust-lang:master Oct 2, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 2, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 2, 2024
Rollup merge of rust-lang#131140 - ismailarilik:handle-potential-query-instability-lint-for-rustc-hir-analysis, r=compiler-errors

Handle `rustc_hir_analysis` cases of `potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_hir_analysis/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir_analysis/src/lib.rs#L61) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: rust-lang#84447
@ismailarilik ismailarilik deleted the handle-potential-query-instability-lint-for-rustc-hir-analysis branch October 3, 2024 05:48
ismailarilik added a commit to ismailarilik/rust that referenced this pull request Oct 6, 2024
This is an attempt to gain the performance loss after the PR rust-lang#131140.
Here the related objects are `IndexSet` so do not require a sort to stay stable.
@ismailarilik
Copy link
Contributor Author

@compiler-errors I know somehow performance is improved in this PR but I think we can improve it further by removing unnecessary sorts. They were exist to make the related sets stable but it isn't necessary anymore. And also we can make them immutable so more secure. The PR for this: #131328

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2024
…rts-in-rustc-hir-analysis, r=compiler-errors

Remove unnecessary sorts in `rustc_hir_analysis`

A follow-up after rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable. And they don't need to be `mut` anymore.

r? `@compiler-errors`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 14, 2024
…rts-in-rustc-hir-analysis, r=compiler-errors

Remove unnecessary sorts in `rustc_hir_analysis`

A follow-up after rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable. And they don't need to be `mut` anymore.

r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 15, 2024
…rts-in-rustc-hir-analysis, r=compiler-errors

Remove unnecessary sorts in `rustc_hir_analysis`

A follow-up after rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable. And they don't need to be `mut` anymore.

r? ```@compiler-errors```
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 15, 2024
Rollup merge of rust-lang#131328 - ismailarilik:remove-unnecessary-sorts-in-rustc-hir-analysis, r=compiler-errors

Remove unnecessary sorts in `rustc_hir_analysis`

A follow-up after rust-lang#131140. Here the related objects are `IndexSet` so do not require a sort to stay stable. And they don't need to be `mut` anymore.

r? ```@compiler-errors```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants