Skip to content

Internal error, cycle detected: infer_query(ConstId(ConstId(0))), const_eval(ConstId(0)) with missing struct name #13378

Open

Description

Reproduce with:

struct <const N: usize = 3>([(); N]);

rust-analyzer version: rust-analyzer version: 0.3.1229-standalone (5c28ad1 2022-10-01)

rustc version: rustc 1.64.0 (a55dd71d5 2022-09-19)

Server Output

Panic context:
> 
version: 0.3.1229-standalone (5c28ad193 2022-10-01)
request: textDocument/semanticTokens/full/delta SemanticTokensDeltaParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Dev/LocalProjects/rust-analyzer/crates/ide-assists/src/handlers/generate_delegate_methods.rs",
            query: None,
            fragment: None,
        },
    },
    previous_result_id: "4",
}

thread 'Worker' panicked at 'Internal error, cycle detected:

infer_query(ConstId(ConstId(0)))
const_eval(ConstId(0))
', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\salsa-0.17.0-pre.2\src\lib.rs:422:35
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library\std\src\panicking.rs:584
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library\core\src\panicking.rs:142
   2: <DB as hir_ty::db::HirDatabase>::infer_query
   3: hir_ty::db::infer_wait
   4: <DB as hir_ty::db::HirDatabase>::infer
   5: hir_ty::consteval::const_eval_variant_query
   6: salsa::runtime::Runtime::execute_query_implementation
   7: core::ptr::drop_in_place<salsa::derived::slot::Memo<hir_ty::db::ProgramClausesForChalkEnvQuery>>
   8: salsa::derived::slot::Slot<Q,MP>::read
   9: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  10: <DB as hir_ty::db::HirDatabase>::const_eval
  11: hir_ty::consteval::eval_const
  12: hir_ty::consteval::eval_to_const
  13: <core::iter::adapters::rev::Rev<I> as core::iter::traits::iterator::Iterator>::fold
  14: <core::iter::adapters::rev::Rev<I> as core::iter::traits::iterator::Iterator>::fold
  15: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_assignee_expr
  16: <core::iter::adapters::rev::Rev<I> as core::iter::traits::iterator::Iterator>::fold
  17: <core::iter::adapters::rev::Rev<I> as core::iter::traits::iterator::Iterator>::fold
  18: hir_ty::infer::infer_query
  19: salsa::runtime::Runtime::execute_query_implementation
  20: core::ptr::drop_in_place<salsa::derived::slot::Memo<hir_ty::db::ProgramClausesForChalkEnvQuery>>
  21: salsa::derived::slot::Slot<Q,MP>::read
  22: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  23: <DB as hir_ty::db::HirDatabase>::infer_query
  24: hir_ty::db::infer_wait
  25: <DB as hir_ty::db::HirDatabase>::infer
  26: hir::source_analyzer::SourceAnalyzer::new_for_body
  27: hir::semantics::SemanticsImpl::analyze_impl
  28: ide_db::defs::NameRefClass::classify
  29: ide::syntax_highlighting::highlight::name_like
  30: ide::syntax_highlighting::highlight
  31: salsa::Cancelled::catch
  32: ide::syntax_highlighting::inject::ra_fixture
  33: ide::syntax_highlighting::highlight
  34: std::panicking::try
  35: rust_analyzer::handlers::handle_semantic_tokens_full_delta
  36: std::panicking::try
  37: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 10:06:39 p.m.] Request textDocument/semanticTokens/full/delta failed.
  Message: request handler panicked: Internal error, cycle detected:

infer_query(ConstId(ConstId(0)))
const_eval(ConstId(0))

  Code: -32603 

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

Metadata

Assignees

No one assigned

    Labels

    A-mirA-tytype system / type inference / traits / method resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions