Skip to content

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

@ismailarilik

Description

@ismailarilik

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() {

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions