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_query_system cases of rustc::potential_query_instability lint #131200

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_query_system/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 rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 3, 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.

@ismailarilik ismailarilik marked this pull request as draft October 3, 2024 13:31
@ismailarilik ismailarilik marked this pull request as ready for review October 3, 2024 16:22
@ismailarilik ismailarilik marked this pull request as draft October 4, 2024 08:24
@ismailarilik
Copy link
Contributor Author

@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 Oct 4, 2024
@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-query_system branch from 062a42c to 1c33630 Compare October 4, 2024 09:12
@ismailarilik ismailarilik force-pushed the handle-potential-query-instability-lint-for-rustc-query_system branch from 1c33630 to f34e703 Compare October 4, 2024 09:39
@ismailarilik ismailarilik marked this pull request as ready for review October 4, 2024 09:40
@ismailarilik
Copy link
Contributor Author

@rustbot review

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

cjgillot commented Oct 5, 2024

Could you point to the place where each of these maps is iterated over?

@ismailarilik
Copy link
Contributor Author

error: using `iter` can result in unstable query results
    --> compiler/rustc_query_system/src/dep_graph/graph.rs:1392:44
     |
1392 |             if let Some((node, _)) = shard.iter().find(|(_, index)| **index == dep_node_index) {
     |                                            ^^^^
     |
     = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
     = note: `-D rustc::potential-query-instability` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(rustc::potential_query_instability)]`

error: using `values` can result in unstable query results
   --> compiler/rustc_query_system/src/dep_graph/serialized.rs:654:50
    |
654 |             let mut stats: Vec<_> = record_stats.values().collect();
    |                                                  ^^^^^^
    |
    = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale

error: using `iter` can result in unstable query results
  --> compiler/rustc_query_system/src/query/plumbing.rs:80:34
   |
80 |             for (k, v) in shard?.iter() {
   |                                  ^^^^
   |
   = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale

error: using `keys` can result in unstable query results
   --> compiler/rustc_query_system/src/query/job.rs:517:47
    |
517 |     let mut jobs: Vec<QueryJobId> = query_map.keys().cloned().collect();
    |                                               ^^^^
    |
    = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale

error: using `iter` can result in unstable query results
  --> compiler/rustc_query_system/src/query/caches.rs:62:33
   |
62 |             for (k, v) in shard.iter() {
   |                                 ^^^^
   |
   = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale

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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants