Skip to content

3000+ QPS of "WARN Propagating panic for cycle" warnings (const-generic related) #23347

Description

@TimNN

Rust Analyzer fails during handle_document_diagnostics (which is fine, the features I use are unstable).

However, what follows is a seemingly infinite number of WARN Propagating panic for cycle head that panicked in an earlier execution in that revision lines, at a rate of approximately 2-4 (sometimes more) per millisecond:

2026-09-12T10:14:58.766006+02:00  WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-09-12T10:14:58.766194+02:00  WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-09-12T10:14:58.766392+02:00  WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-09-12T10:14:58.766602+02:00  WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-09-12T10:14:58.766801+02:00  WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-09-12T10:14:58.766976+02:00  WARN Propagating panic for cycle head that panicked in an earlier execution in that revision

It would be great if this could fail more gracefully.

Initial Panic:
thread 'Worker3' (878036) panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ena-0.14.4/src/snapshot_vec.rs:199:10:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: <ra_ap_rustc_next_trait_solver::resolve::EagerResolver<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner> as ra_ap_rustc_type_ir::fold::TypeFolder<hir_ty::next_solver::interner::DbInterner>>::fold_const
   4: <hir_ty::next_solver::generic_arg::GenericArgs as ra_ap_rustc_type_ir::fold::TypeFoldable<hir_ty::next_solver::interner::DbInterner>>::fold_with::<ra_ap_rustc_next_trait_solver::resolve::EagerResolver<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>
   5: <ra_ap_rustc_next_trait_solver::resolve::EagerResolver<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner> as ra_ap_rustc_type_ir::fold::TypeFolder<hir_ty::next_solver::interner::DbInterner>>::fold_ty
   6: <hir_ty::next_solver::generic_arg::GenericArgs as ra_ap_rustc_type_ir::fold::TypeFoldable<hir_ty::next_solver::interner::DbInterner>>::fold_with::<ra_ap_rustc_next_trait_solver::resolve::EagerResolver<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>
   7: <ra_ap_rustc_type_ir::solve::Goal<hir_ty::next_solver::interner::DbInterner, hir_ty::next_solver::predicate::Predicate> as ra_ap_rustc_type_ir::fold::TypeFoldable<hir_ty::next_solver::interner::DbInterner>>::fold_with::<ra_ap_rustc_next_trait_solver::resolve::EagerResolver<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>
   8: ra_ap_rustc_next_trait_solver::resolve::eager_resolve_vars::<hir_ty::next_solver::solver::SolverContext, (ra_ap_rustc_type_ir::solve::Goal<hir_ty::next_solver::interner::DbInterner, hir_ty::next_solver::predicate::Predicate>, alloc::vec::Vec<(ra_ap_rustc_type_ir::opaque_ty::OpaqueTypeKey<hir_ty::next_solver::interner::DbInterner>, hir_ty::next_solver::ty::Ty)>)>
   9: <hir_ty::next_solver::solver::SolverContext as ra_ap_rustc_next_trait_solver::solve::eval_ctxt::SolverDelegateEvalExt>::evaluate_root_goal_for_proof_tree
  10: <hir_ty::next_solver::infer::InferCtxt>::select
  11: hir_ty::method_resolution::lookup_impl_assoc_item_for_trait_ref
  12: hir_ty::method_resolution::lookup_impl_const
  13: <hir_ty::mir::eval::Evaluator>::eval_operand
  14: <hir_ty::mir::eval::Evaluator>::eval_rvalue
  15: hir_ty::mir::eval::interpret_mir
  16: <hir_ty::consteval::anon_const_eval::_::anon_const_eval_query_Configuration_ as salsa::function::Configuration>::execute
  17: <salsa::function::IngredientImpl<hir_ty::consteval::anon_const_eval::_::anon_const_eval_query_Configuration_>>::execute
  18: hir_ty::consteval::anon_const_eval
  19: <hir_ty::next_solver::solver::SolverContext as ra_ap_rustc_next_trait_solver::delegate::SolverDelegate>::evaluate_const
  20: <ra_ap_rustc_type_ir::search_graph::SearchGraph<ra_ap_rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<hir_ty::next_solver::solver::SolverContext>, hir_ty::next_solver::interner::DbInterner>>::evaluate_goal_in_task
  21: <ra_ap_rustc_type_ir::search_graph::SearchGraph<ra_ap_rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<hir_ty::next_solver::solver::SolverContext>, hir_ty::next_solver::interner::DbInterner>>::evaluate_goal
  22: <ra_ap_rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>::try_evaluate_added_goals
  23: <ra_ap_rustc_type_ir::search_graph::SearchGraph<ra_ap_rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<hir_ty::next_solver::solver::SolverContext>, hir_ty::next_solver::interner::DbInterner>>::evaluate_goal_in_task
  24: <ra_ap_rustc_type_ir::search_graph::SearchGraph<ra_ap_rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<hir_ty::next_solver::solver::SolverContext>, hir_ty::next_solver::interner::DbInterner>>::evaluate_goal
  25: <ra_ap_rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>::evaluate_goal
  26: <ra_ap_rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>::try_evaluate_added_goals
  27: <ra_ap_rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>::evaluate_added_goals_and_make_canonical_response
  28: <ra_ap_rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>::assemble_impl_candidates::<ra_ap_rustc_type_ir::predicate::TraitPredicate<hir_ty::next_solver::interner::DbInterner>>::{closure#0}
  29: <ra_ap_rustc_next_trait_solver::solve::eval_ctxt::EvalCtxt<hir_ty::next_solver::solver::SolverContext, hir_ty::next_solver::interner::DbInterner>>::compute_trait_goal
  30: <ra_ap_rustc_type_ir::search_graph::SearchGraph<ra_ap_rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<hir_ty::next_solver::solver::SolverContext>, hir_ty::next_solver::interner::DbInterner>>::evaluate_goal_in_task
  31: <ra_ap_rustc_type_ir::search_graph::SearchGraph<ra_ap_rustc_next_trait_solver::solve::search_graph::SearchGraphDelegate<hir_ty::next_solver::solver::SolverContext>, hir_ty::next_solver::interner::DbInterner>>::evaluate_goal
  32: <hir_ty::next_solver::fulfill::FulfillmentCtxt>::try_evaluate_obligations
  33: <hir_ty::infer::InferenceContext>::infer_path
  34: <hir_ty::infer::InferenceContext>::infer_expr_inner
  35: <hir_ty::infer::InferenceContext>::infer_call
  36: <hir_ty::infer::InferenceContext>::infer_expr_inner
  37: <hir_ty::infer::InferenceContext>::infer_expr_inner
  38: <hir_ty::infer::InferenceContext>::infer_return
  39: hir_ty::infer::infer_query_with_inspect
  40: <salsa::function::IngredientImpl<<hir_ty::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute
  41: <hir_ty::infer::InferenceResult>::for_body
  42: <hir::diagnostics::DiagnosticsCollector>::emit_inference_errors
  43: <hir::diagnostics::DiagnosticsCollector>::collect_def_with_body
  44: <hir::diagnostics::DiagnosticsCollector>::collect_module_def
  45: <hir::diagnostics::DiagnosticsCollector>::collect_module
  46: <hir::Module>::diagnostics
  47: ide_diagnostics::semantic_diagnostics
  48: ide_diagnostics::full_diagnostics
  49: <ide::Analysis>::full_diagnostics
  50: rust_analyzer::handlers::request::handle_document_diagnostics
  51: <<stdx::thread::pool::Pool>::spawn<<rust_analyzer::task_pool::TaskPool<rust_analyzer::main_loop::Task>>::spawn<<rust_analyzer::handlers::dispatch::RequestDispatcher>::on_with_thread_intent<false, false, gen_lsp_types::generated::requests::DocumentDiagnosticRequest>::{closure#0}>::{closure#0}>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stacktrace:
   0: anon_const_eval_query(Id(16700)) -> (R3298, Durability::LOW)
             at crates/hir-ty/src/consteval.rs:519
   1: InferenceResult < 'db >::for_body_(Id(2101)) -> (R3298, Durability::LOW)
             at crates/hir-ty/src/infer.rs:1077

additional context:
   0: 
version: 0.4.3046-standalone (6aeeb8cf02 2026-09-11)
request: textDocument/diagnostic DocumentDiagnosticParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "<redacted>",
            query: None,
            fragment: None,
        },
    },
    identifier: Some(
        "rust-analyzer",
    ),
    previous_result_id: None,
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

rust-analyzer version: rust-analyzer version: 0.4.3046-standalone (6aeeb8cf02 2026-09-11)

rustc version: rustc 1.100.0-nightly (0fc141305 2026-09-11)

editor or extension: VS Code with rust-lang.rust-analyzer version 0.4.3046

relevant settings: n/a

repository link (if public, optional): n/a

code snippet to reproduce:

#![allow(incomplete_features)]
#![feature(
    portable_simd,
    min_generic_const_args,
    macroless_generic_const_args
)]

use std::simd::Simd;

pub trait Calc {
    type const V: usize;
}

pub struct Mul<const N: usize, const M: usize>;

impl Calc for Mul<4, 2> {
    type const V: usize = const { 8 };
}

impl Calc for Mul<4, 4> {
    type const V: usize = const { 16 };
}

// Commenting the next two impls stops the log spam.

impl Calc for Mul<2, 2> {
    type const V: usize = const { 8 };
}

impl Calc for Mul<2, 4> {
    type const V: usize = const { 8 };
}

type SimdM<T, const N: usize, const M: usize> = Simd<T, { <Mul<N, M> as Calc>::V }>;

pub fn repro_gen<const N: usize>(_: &[u32; N])
where
    Mul<N, 2>: Calc,
    Mul<N, 4>: Calc,
    SimdM<u16, N, 2>: Copy,
{
}

pub fn repro() {
    repro_gen(&[0u32; 4]);
    // Explicitly specifying the `<4>` stops the log spam
    // repro_gen::<4>(&[0u32; 4]);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bugI-panic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions