Skip to content

Unexpected panic in rustc_query_system while running 'x clippy' #15338

@hkBst

Description

@hkBst

Initially discovered running 'x clippy', but reproduces also with 'x clippy rustc_query_system', though I'm not sure that actually does less work, on commit cdac44e608c3df9a241e0a1b53b3f62af250dbf1.

Relevant part of backtrace:

thread 'rustc' panicked at /home/gh-hkBst/rust/compiler/rustc_errors/src/diagnostic.rs:959:9:
assertion `left == right` failed: Span must not be empty and have no suggestion
  left: Some(SubstitutionPart { span: compiler/rustc_query_system/src/dep_graph/graph.rs:871:82: 871:82 (#0), snippet: "" })
 right: None
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panicking.rs:75:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed::<core::option::Option<&rustc_errors::SubstitutionPart>, core::option::Option<&rustc_errors::SubstitutionPart>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panicking.rs:387:5
   4: multipart_suggestion_with_style<(), &str>
             at ./compiler/rustc_errors/src/diagnostic.rs:959:9
   5: multipart_suggestion_verbose<(), &str>
             at ./compiler/rustc_errors/src/diagnostic.rs:933:14
   6: {closure#0}
             at ./src/tools/clippy/clippy_lints/src/returns.rs:477:18

The panic occurs in this code:

    /// [`Diag::multipart_suggestion()`] but you can set the [`SuggestionStyle`].
    #[rustc_lint_diagnostics]
    pub fn multipart_suggestion_with_style(
        &mut self,
        msg: impl Into<SubdiagMessage>,
        mut suggestion: Vec<(Span, String)>,
        applicability: Applicability,
        style: SuggestionStyle,
    ) -> &mut Self {
        let mut seen = crate::FxHashSet::default();
        suggestion.retain(|(span, msg)| seen.insert((span.lo(), span.hi(), msg.clone())));

        let parts = suggestion
            .into_iter()
            .map(|(span, snippet)| SubstitutionPart { snippet, span })
            .collect::<Vec<_>>();

        assert!(!parts.is_empty());
        debug_assert_eq!( // <===================================== panics here 
            parts.iter().find(|part| part.span.is_empty() && part.snippet.is_empty()),
            // ^~~ this is: Some(SubstitutionPart { span: compiler/rustc_query_system/src/dep_graph/graph.rs:871:82: 871:82 (#0), snippet: "" })
            None,
            "Span must not be empty and have no suggestion",
        );
        debug_assert_eq!(
            parts.array_windows().find(|[a, b]| a.span.overlaps(b.span)),
            None,
            "suggestion must not have overlapping parts",
        );

        self.push_suggestion(CodeSuggestion {
            substitutions: vec![Substitution { parts }],
            msg: self.subdiagnostic_message_to_diagnostic_message(msg),
            style,
            applicability,
        });
        self
    }

The offending code that clippy chokes on follows. The position (871:82) it points to is after the ending newline on line 871:

    #[instrument(skip(self, qcx, parent_dep_node_index, frame), level = "debug")] // this is line 871 (81 chars long)
    fn try_mark_parent_green<Qcx: QueryContext<Deps = D>>(
        &self,
        qcx: Qcx,
        parent_dep_node_index: SerializedDepNodeIndex,
        frame: Option<&MarkFrame<'_>>,
    ) -> Option<()> {
        let dep_dep_node_color = self.colors.get(parent_dep_node_index);
        let dep_dep_node = &self.previous.index_to_node(parent_dep_node_index);

        match dep_dep_node_color {
            Some(DepNodeColor::Green(_)) => {
                // This dependency has been marked as green before, we are
                // still fine and can continue with checking the other
                // dependencies.
                debug!("dependency {dep_dep_node:?} was immediately green");
                return Some(());
            }
            Some(DepNodeColor::Red) => {
                // We found a dependency the value of which has changed
                // compared to the previous compilation session. We cannot
                // mark the DepNode as green and also don't need to bother
                // with checking any of the other dependencies.
                debug!("dependency {dep_dep_node:?} was immediately red");
                return None;
            }
            None => {}
        }
Backtrace

thread 'rustc' panicked at /home/gh-hkBst/rust/compiler/rustc_errors/src/diagnostic.rs:959:9:
assertion `left == right` failed: Span must not be empty and have no suggestion
  left: Some(SubstitutionPart { span: compiler/rustc_query_system/src/dep_graph/graph.rs:871:82: 871:82 (#0), snippet: "" })
 right: None
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panicking.rs:75:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed::<core::option::Option<&rustc_errors::SubstitutionPart>, core::option::Option<&rustc_errors::SubstitutionPart>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panicking.rs:387:5
   4: multipart_suggestion_with_style<(), &str>
             at ./compiler/rustc_errors/src/diagnostic.rs:959:9
   5: multipart_suggestion_verbose<(), &str>
             at ./compiler/rustc_errors/src/diagnostic.rs:933:14
   6: {closure#0}
             at ./src/tools/clippy/clippy_lints/src/returns.rs:477:18
   7: {closure#0}<rustc_span::span_encoding::Span, &str, clippy_lints::returns::emit_return_lint::{closure_env#0}>
             at ./src/tools/clippy/clippy_utils/src/diagnostics.rs:341:9
   8: call_once<clippy_utils::diagnostics::span_lint_hir_and_then::{closure_env#0}<rustc_span::span_encoding::Span, &str, clippy_lints::returns::emit_return_lint::{closure_env#0}>, (&mut rustc_errors::diagnostic::Diag<()>)>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/ops/function.rs:250:5
   9: call_once<(&mut rustc_errors::diagnostic::Diag<()>), dyn core::ops::function::FnOnce<(&mut rustc_errors::diagnostic::Diag<()>), Output=()>, alloc::alloc::Global>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/alloc/src/boxed.rs:1966:9
  10: lint_level_impl
             at ./compiler/rustc_middle/src/lint.rs:427:13
  11: lint_level<clippy_utils::diagnostics::span_lint_hir_and_then::{closure_env#0}<rustc_span::span_encoding::Span, &str, clippy_lints::returns::emit_return_lint::{closure_env#0}>>
             at ./compiler/rustc_middle/src/lint.rs:433:5
  12: node_span_lint<rustc_span::span_encoding::Span, clippy_utils::diagnostics::span_lint_hir_and_then::{closure_env#0}<rustc_span::span_encoding::Span, &str, clippy_lints::returns::emit_return_lint::{closure_env#0}>>
             at ./compiler/rustc_middle/src/ty/context.rs:3139:9
  13: clippy_utils::diagnostics::span_lint_hir_and_then::<rustc_span::span_encoding::Span, &str, clippy_lints::returns::emit_return_lint::{closure#0}>
             at ./src/tools/clippy/clippy_utils/src/diagnostics.rs:339:12
  14: emit_return_lint
             at ./src/tools/clippy/clippy_lints/src/returns.rs:466:5
  15: check_final_expr
             at ./src/tools/clippy/clippy_lints/src/returns.rs:426:13
  16: check_block_return
  17: check_final_expr
             at ./src/tools/clippy/clippy_lints/src/returns.rs:454:28
  18: check_block_return
  19: check_final_expr
             at ./src/tools/clippy/clippy_lints/src/returns.rs:454:28
  20: check_block_return
  21: check_final_expr
             at ./src/tools/clippy/clippy_lints/src/returns.rs:454:28
  22: check_block_return
  23: check_fn
             at ./src/tools/clippy/clippy_lints/src/returns.rs:307:17
  24: check_fn
             at ./compiler/rustc_lint/src/late.rs:328:26
  25: visit_fn<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:33:14
  26: rustc_hir::intravisit::walk_impl_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:1285:55
  27: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:288:17
  28: with_param_env<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_impl_item::{closure#0}::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:71:9
  29: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:286:16
  30: with_lint_attrs<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_impl_item::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:59:9
  31: visit_impl_item<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:285:14
  32: visit_nested_impl_item<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:271:29
  33: rustc_hir::intravisit::walk_impl_item_ref::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:1310:24
  34: walk_item<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:616:13
  35: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:132:17
  36: with_param_env<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure#0}::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:71:9
  37: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:130:16
  38: with_lint_attrs<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:59:9
  39: visit_item<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:129:14
  40: visit_nested_item<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:249:29
  41: walk_mod<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:651:5
  42: walk_item<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:580:32
  43: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:132:17
  44: with_param_env<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure#0}::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:71:9
  45: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:130:16
  46: with_lint_attrs<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:59:9
  47: visit_item<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:129:14
  48: visit_nested_item<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:249:29
  49: walk_mod<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:651:5
  50: walk_item<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:580:32
  51: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:132:17
  52: with_param_env<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure#0}::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:71:9
  53: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:130:16
  54: with_lint_attrs<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::{impl#1}::visit_item::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:59:9
  55: visit_item<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:129:14
  56: visit_nested_item<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:249:29
  57: walk_mod<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_hir/src/intravisit.rs:651:5
  58: {closure#0}<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:448:13
  59: with_lint_attrs<rustc_lint::late::RuntimeCombinedLateLintPass, rustc_lint::late::late_lint_crate_inner::{closure_env#0}<rustc_lint::late::RuntimeCombinedLateLintPass>>
             at ./compiler/rustc_lint/src/late.rs:59:9
  60: late_lint_crate_inner<rustc_lint::late::RuntimeCombinedLateLintPass>
             at ./compiler/rustc_lint/src/late.rs:444:8
  61: late_lint_crate
             at ./compiler/rustc_lint/src/late.rs:433:5
  62: {closure#0}
             at ./compiler/rustc_lint/src/late.rs:459:17
  63: run<(), rustc_lint::late::check_crate::{closure#0}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/profiling.rs:839:9
  64: time<(), rustc_lint::late::check_crate::{closure#0}::{closure_env#0}>
             at ./compiler/rustc_session/src/utils.rs:16:50
  65: {closure#0}
             at ./compiler/rustc_lint/src/late.rs:457:22
  66: call_once<(), rustc_lint::late::check_crate::{closure_env#0}>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panic/unwind_safe.rs:272:9
  67: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure_env#0}>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:589:40
  68: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure_env#0}>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:552:19
  69: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_lint::late::check_crate::{closure_env#0}>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panic.rs:359:14
  70: run<(), rustc_lint::late::check_crate::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:23:9
  71: {closure#0}<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:52:23
  72: parallel_guard<(core::option::Option<()>, core::option::Option<()>), rustc_data_structures::sync::parallel::serial_join::{closure_env#0}<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:39:15
  73: serial_join<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:51:18
  74: join<rustc_lint::late::check_crate::{closure_env#0}, rustc_lint::late::check_crate::{closure_env#1}, (), ()>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:132:9
  75: check_crate
             at ./compiler/rustc_lint/src/late.rs:455:5
  76: {closure#0}
             at ./compiler/rustc_interface/src/passes.rs:1165:29
  77: run<(), rustc_interface::passes::analysis::{closure#0}::{closure#2}::{closure#0}::{closure#2}::{closure#1}::{closure#0}::{closure#2}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/profiling.rs:839:9
  78: time<(), rustc_interface::passes::analysis::{closure#0}::{closure#2}::{closure#0}::{closure#2}::{closure#1}::{closure#0}::{closure#2}::{closure_env#0}>
             at ./compiler/rustc_session/src/utils.rs:16:50
  79: {closure#2}
             at ./compiler/rustc_interface/src/passes.rs:1164:30
  80: call_once<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panic/unwind_safe.rs:272:9
  81: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:589:40
  82: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:552:19
  83: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panic.rs:359:14
  84: run<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:23:9
  85: {closure#0}
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:88:29
  86: parallel_guard<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure#0}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:39:15
  87: {closure#0}
             at ./compiler/rustc_interface/src/passes.rs:1154:17
  88: call_once<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panic/unwind_safe.rs:272:9
  89: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:589:40
  90: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:552:19
  91: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panic.rs:359:14
  92: run<(), rustc_interface::passes::analysis::{closure#0}::{closure#1}::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:23:9
  93: {closure#1}
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:87:27
  94: parallel_guard<(), rustc_interface::passes::analysis::{closure#0}::{closure_env#1}>
             at ./compiler/rustc_data_structures/src/sync/parallel.rs:39:15
  95: {closure#0}
             at ./compiler/rustc_interface/src/passes.rs:1150:9
  96: run<(), rustc_interface::passes::analysis::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/profiling.rs:839:9
  97: time<(), rustc_interface::passes::analysis::{closure_env#0}>
             at ./compiler/rustc_session/src/utils.rs:16:50
  98: analysis
             at ./compiler/rustc_interface/src/passes.rs:1149:10
  99: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:294:9
      [... omitted 22 frames ...]
 100: query_ensure<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>>
             at ./compiler/rustc_middle/src/query/plumbing.rs:198:9
 101: analysis
             at ./compiler/rustc_middle/src/query/plumbing.rs:233:9
 102: {closure#2}
             at ./compiler/rustc_driver_impl/src/lib.rs:370:29
 103: {closure#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:1002:27
 104: {closure#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context.rs:1520:37
 105: {closure#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:60:9
 106: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/thread/local.rs:315:12
 107: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/thread/local.rs:279:20
 108: enter_context<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:57:9
 109: enter<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context.rs:1520:9
 110: create_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>>
             at ./compiler/rustc_middle/src/ty/context.rs:1721:13
 111: {closure#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:969:9
 112: call_once<rustc_interface::passes::create_and_enter_global_ctxt::{closure_env#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, (&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2})>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/ops/function.rs:250:5
 113: call_once<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), dyn core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), Output=core::option::Option<rustc_interface::queries::Linker>>, alloc::alloc::Global>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/alloc/src/boxed.rs:1966:9
 114: create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:1010:5
 115: {closure#0}
             at ./compiler/rustc_driver_impl/src/lib.rs:343:22
 116: {closure#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at ./compiler/rustc_interface/src/interface.rs:525:80
 117: call_once<(), rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/core/src/panic/unwind_safe.rs:272:9
 118: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:589:40
 119: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panicking.rs:552:19
 120: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/390a0ab5dc4a895235a551e502c3893c3337731d/library/std/src/panic.rs:359:14
 121: {closure#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at ./compiler/rustc_interface/src/interface.rs:525:23
 122: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>
             at ./compiler/rustc_interface/src/util.rs:199:17
 123: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at ./compiler/rustc_interface/src/util.rs:153:24
 124: set<rustc_span::SessionGlobals, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>, ()>
             at /home/gh-hkBst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/scoped-tls-1.0.1/src/lib.rs:137:9
 125: create_session_globals_then<(), rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>>
             at ./compiler/rustc_span/src/lib.rs:145:21
 126: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at ./compiler/rustc_interface/src/util.rs:149:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/home/gh-hkBst/rust/rustc-ice-2025-07-11T09_47_29-1644615.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=line-tables-only -C debug-assertions=on -C symbol-mangling-version=v0 -Z unstable-options -Z force-unstable-if-unmarked -Z macro-backtrace -C split-debuginfo=off -C force-frame-pointers=true -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z on-broken-pipe=kill -C lto=off -Z binary-dep-depinfo -Z tls-model=initial-exec -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
note: Clippy version: clippy 0.1.90 (cdac44e608 2025-07-11)

warning: `rustc_query_system` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p rustc_query_system` to apply 2 suggestions)
error: could not compile `rustc_query_system` (lib); 3 warnings emitted

Caused by:
  process didn't exit successfully: `/home/gh-hkBst/rust/build/bootstrap/debug/rustc /home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1/bin/clippy-driver /home/gh-hkBst/rust/build/bootstrap/debug/rustc --crate-name rustc_query_system --edition=2024 compiler/rustc_query_system/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=211 --crate-type lib --emit=dep-info,metadata -C opt-level=3 -C embed-bitcode=no -C debuginfo=line-tables-only -C debug-assertions=on --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=ccd0063bc5eb9342 -C extra-filename=-b9049f2edf31ad53 --out-dir /home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps --target aarch64-unknown-linux-gnu -L dependency=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps -L dependency=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/release/deps --extern hashbrown=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/libhashbrown-e919af7e877288e6.rmeta --extern parking_lot=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/libparking_lot-dd3eefbf0442fc0a.rmeta --extern rustc_abi=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_abi-af083a72ab1f67dd.rmeta --extern rustc_ast=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_ast-b764bef5c83cce8e.rmeta --extern rustc_attr_data_structures=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_attr_data_structures-40553a2118096179.rmeta --extern rustc_data_structures=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_data_structures-206fe2fd1a633c7a.rmeta --extern rustc_errors=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_errors-f120eb5cafb43029.rmeta --extern rustc_feature=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_feature-edc51cda89e21918.rmeta --extern rustc_fluent_macro=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/release/deps/librustc_fluent_macro-6bac943e67724392.so --extern rustc_hashes=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_hashes-5d5ca95b7cac266d.rmeta --extern rustc_hir=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_hir-0406227f024e2a4a.rmeta --extern rustc_index=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_index-107ace332e43e4e3.rmeta --extern rustc_macros=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/release/deps/librustc_macros-45fbcebfc22a0054.so --extern rustc_serialize=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_serialize-70a61fd5cdf3f563.rmeta --extern rustc_session=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_session-4b847d43e38dec46.rmeta --extern rustc_span=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_span-550968e4736b11c5.rmeta --extern rustc_thread_pool=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/librustc_thread_pool-7df28e6b564e092f.rmeta --extern smallvec=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/libsmallvec-51dd69a1c6ba7275.rmeta --extern tracing=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/deps/libtracing-13ca5ff26e4da5fe.rmeta --sysroot /home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1 --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zforce-unstable-if-unmarked -Zmacro-backtrace -Csplit-debuginfo=off -Cforce-frame-pointers=true -Cllvm-args=-import-instr-limit=10 -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages -Zon-broken-pipe=kill -Clto=off -Z binary-dep-depinfo -L native=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/build/psm-fd0c6a459c1d7cde/out -L native=/home/gh-hkBst/rust/build/aarch64-unknown-linux-gnu/stage1-rustc/aarch64-unknown-linux-gnu/release/build/blake3-5976321c9ed667de/out` (exit status: 101)
Build completed unsuccessfully in 0:01:08

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingE-needs-mcveCall for participation: This issue needs a Minimal Complete and Verifiable ExampleI-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions