Skip to content

Spammed with textDocument/hover failed + other related errors #14474

Closed
@RaminKav

Description

@RaminKav

rust-analyzer version: v0.3.1459

rustc version: rustc 1.67.0 (fc594f156 2023-01-24)

relevant settings: N/A (i think)
Restarting RA or VSCode, or downgrading to an RA version 1 week older did not work.
Hovering over most parts of my document spams the message in the title, with the following error log:

Panic context:
> 
version: 0.3.1459-standalone (236576227 2023-04-02)
request: textDocument/hover HoverParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/Users/ramin/Documents/Dev/horizon-games/SkyWeaver/state/state/src/live_game.rs",
            query: None,
            fragment: None,
        },
    },
    position: Position(
        Position {
            line: 575,
            character: 44,
        },
    ),
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
}

thread 'Worker' panicked at 'index out of bounds: the len is 1 but the index is 1', crates/hir-ty/src/mir/eval.rs:1161:52
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: <hir_ty::mir::eval::Evaluator::ty_filler::Filler as chalk_ir::fold::FallibleTypeFolder<hir_ty::interner::Interner>>::try_fold_ty
   4: hir_ty::mir::eval::Evaluator::size_of
   5: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
   6: core::iter::adapters::try_process
   7: hir_ty::mir::eval::interpret_mir
   8: hir_ty::consteval::eval_to_const
   9: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  10: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  11: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
  12: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  13: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  14: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
  15: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  16: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  17: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
  18: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_async_block
  19: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_return
  20: hir_ty::infer::infer_query
  21: salsa::runtime::Runtime::execute_query_implementation
  22: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  23: salsa::derived::slot::Slot<Q,MP>::read
  24: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  25: <DB as hir_ty::db::HirDatabase>::infer_query::__shim
  26: <DB as hir_ty::db::HirDatabase>::infer_query
  27: hir_ty::db::infer_wait
  28: <DB as hir_ty::db::HirDatabase>::infer
  29: hir::source_analyzer::SourceAnalyzer::new_for_body
  30: hir::semantics::SemanticsImpl::analyze_impl
  31: ide_db::defs::NameRefClass::classify
  32: ide_db::defs::IdentClass::classify_node
  33: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  34: <itertools::unique_impl::UniqueBy<I,V,F> as core::iter::traits::iterator::Iterator>::next
  35: ide::hover::hover
  36: std::panicking::try
  37: rust_analyzer::handlers::handle_hover
  38: std::panicking::try
  39: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 11:36:46 AM] Request textDocument/hover failed.
  Message: request handler panicked: index out of bounds: the len is 1 but the index is 1
  Code: -32603 

Metadata

Metadata

Assignees

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