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

Add rationale for rustc_lint behind allowing rustc::potential-query-instability lint #131317

Open
ismailarilik opened this issue Oct 6, 2024 · 1 comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ismailarilik
Copy link
Contributor

ismailarilik commented Oct 6, 2024

Context: #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 this occurrence in the file compiler/rustc_lint/src/context/diagnostics/check_cfg.rs:

pub(super) fn unexpected_cfg_name(
    sess: &Session,
    (name, name_span): (Symbol, Span),
    value: Option<(Symbol, Span)>,
) -> lints::UnexpectedCfgName {
    #[allow(rustc::potential_query_instability)]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    let possibilities: Vec<Symbol> = sess.psess.check_config.expecteds.keys().copied().collect();

    let mut names_possibilities: Vec<_> = if value.is_none() {
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 6, 2024
@ismailarilik
Copy link
Contributor Author

@rustbot label C-cleanup T-compiler

@rustbot rustbot added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 6, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants