rust-lang / rust-lang/rust

Add rationale for `rustc_type_ir` behind allowing rustc::potential-query-instability lint

Open
#131,318 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-cleanup T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Context: https://github.com/rust-lang/rust/issues/84447

Motivation:

  1. This lint asks to do so. An example:
    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
    
  2. This would prevent further fix attempts so wastes of time as well.
  3. Nearly all of those allowances has a comment which explains the rationale.

To do: Add a comment explaning the rationale behind allowing rustc::potential-query-instability lint for all occurrences in the file compiler/rustc_type_ir/src/search_graph/mod.rs. You can find the places where this lint is triggered by searching with #[allow(rustc::potential_query_instability)] in this file.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open compiler/rustc_type_ir/src/search_graph/mod.rs and search for #[allow(rustc::potential_query_instability)] to locate every occurrence. Read the surrounding code and existing comments to understand each allowance, then add a rationale comment for each one. Done means all occurrences in the file explain why the allowance is intentional.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.