Skip to content

Handle rustc_middle cases of rustc::potential_query_instability lint #131160

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ismailarilik
Copy link
Contributor

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

A somewhat tracking issue: #84447

r? @compiler-errors

@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 @compiler-errors (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
@rustbot
Copy link
Collaborator

rustbot commented Oct 2, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rust-log-analyzer

This comment has been minimized.

@ismailarilik ismailarilik marked this pull request as draft October 3, 2024 04:52
@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-middle branch from da9a8fd to 4c46978 Compare October 3, 2024 05:56
@rust-log-analyzer

This comment has been minimized.

@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-middle branch from 4c46978 to afeabb2 Compare October 3, 2024 07:46
@ismailarilik ismailarilik marked this pull request as ready for review October 3, 2024 09:02
@ismailarilik ismailarilik marked this pull request as draft October 4, 2024 08:24
@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-middle branch 2 times, most recently from e8cc67a to 0000613 Compare October 4, 2024 08:58
@ismailarilik ismailarilik marked this pull request as ready for review October 4, 2024 08:59
@bors
Copy link
Collaborator

bors commented Oct 10, 2024

☔ The latest upstream changes (presumably #131263) made this pull request unmergeable. Please resolve the merge conflicts.

@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-middle branch from 0000613 to 01e27a3 Compare October 28, 2024 10:15
@bors
Copy link
Collaborator

bors commented Nov 12, 2024

☔ The latest upstream changes (presumably #132282) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors
Copy link
Member

I'm gonna re-roll this so this PR gets more attention, sorry for my inactivity.

r? compiler

But also reassigning to author sicne I think this PR still needs updating.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 23, 2025
@SparrowLii
Copy link
Member

@ismailarilik Can you rebase the PR today? I'm in holiday tomorrow so I"d like to have a review before that :)

@SparrowLii
Copy link
Member

r? compiler cause I'm going to the holidays in the next few days.

And I suggest to run a rustc perf when it's ready since this PR change the cache struct

@rustbot rustbot assigned estebank and unassigned SparrowLii Jan 26, 2025
@Dylan-DPC
Copy link
Member

@ismailarilik any updates on this? thanks

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Feb 26, 2025
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-middle branch from ccae5e3 to 095de4a Compare April 5, 2025 09:15
@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 5, 2025
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-middle branch from 095de4a to 6f1b172 Compare April 5, 2025 09:56
@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 5, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@ismailarilik
Copy link
Contributor Author

How can I update "*.fixed" files? ./x test tests/ui --bless is not producing any change.

@jieyouxu
Copy link
Member

How can I update "*.fixed" files? ./x test tests/ui --bless is not producing any change.

I believe the failing tests are clippy tests, not rustc/compiletest tests. You may need to rebless clippy tests via something like

$ ./x test clippy --bless

@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-middle branch from 6d87d32 to 6bf8881 Compare April 29, 2025 21:09
@jieyouxu
Copy link
Member

jieyouxu commented May 1, 2025

r? query-system

@rustbot rustbot assigned oli-obk and unassigned estebank May 1, 2025
@oli-obk
Copy link
Contributor

oli-obk commented May 1, 2025

@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 May 1, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request May 1, 2025
…instability-lint-for-rustc-middle, r=<try>

Handle `rustc_middle` cases of `rustc::potential_query_instability` lint

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

A somewhat tracking issue: rust-lang#84447

r? `@compiler-errors`
@bors
Copy link
Collaborator

bors commented May 1, 2025

⌛ Trying commit 6bf8881 with merge 9d711dc...

@bors
Copy link
Collaborator

bors commented May 1, 2025

☀️ Try build successful - checks-actions
Build commit: 9d711dc (9d711dcae3bcbeb0efda0beffb8e957488893e63)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9d711dc): comparison URL.

Overall result: ❌✅ regressions and 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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.6% [0.4%, 0.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.1%, secondary -0.8%)

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.8% [0.4%, 1.4%] 10
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
-0.9% [-1.9%, -0.4%] 12
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) -0.1% [-1.9%, 1.4%] 22

Cycles

Results (primary -0.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)
0.6% [0.4%, 0.9%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.0%, -0.4%] 14
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.0%, 0.9%] 20

Binary size

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

Bootstrap: 768.358s -> 769.173s (0.11%)
Artifact size: 365.48 MiB -> 365.43 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 1, 2025
@@ -3520,6 +3520,8 @@ pub fn trimmed_def_paths(tcx: TyCtxt<'_>, (): ()) -> DefIdMap<Symbol> {

// Put the symbol from all the unique namespace+symbol pairs into `map`.
let mut map: DefIdMap<Symbol> = Default::default();
// Precatious is taken below in the loop so we can allow this lint here.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Precatious is taken below in the loop so we can allow this lint here.
// Precautions are taken below in the loop so we can allow this lint here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Tho this is only used in diagnostics, right? we could just use an IndexMap for unique_symbols_rev, too?

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.