Skip to content

Index out of bounds: the len is 1 but the index is 1Β #5366

Open
@MikailBag

Description

panic message:

thread '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 1', crates/ra_hir_def/src/nameres/path_resolution.rs:275:33
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1504
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:511
  11: rust_begin_unwind
             at src/libstd/panicking.rs:419
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
  13: core::panicking::panic_bounds_check
             at src/libcore/panicking.rs:69
  14: ra_hir_def::nameres::path_resolution::<impl ra_hir_def::nameres::CrateDefMap>::resolve_path_fp_with_macro
  15: ra_hir_def::resolver::Resolver::resolve_path_in_type_ns
  16: ra_hir_ty::lower::<impl ra_hir_ty::Ty>::from_hir_ext
  17: ra_hir_ty::lower::impl_self_ty_query
  18: salsa::runtime::Runtime::execute_query_implementation
  19: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  20: salsa::derived::slot::Slot<Q,MP>::read
  21: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  22: <DB as ra_hir_ty::db::HirDatabase>::impl_self_ty::__shim
  23: <DB as ra_hir_ty::db::HirDatabase>::impl_self_ty
  24: ra_hir_ty::lower::impl_trait_query
  25: salsa::runtime::Runtime::execute_query_implementation
  26: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  27: salsa::derived::slot::Slot<Q,MP>::maybe_changed_since
  28: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::maybe_changed_since
  29: salsa::derived::slot::MemoRevisions::validate_memoized_value
  30: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  31: salsa::derived::slot::Slot<Q,MP>::read
  32: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  33: <DB as ra_hir_ty::db::HirDatabase>::trait_impls_in_crate::__shim
  34: ra_hir_ty::method_resolution::TraitImpls::trait_impls_in_deps_query
  35: salsa::runtime::Runtime::execute_query_implementation
  36: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  37: salsa::derived::slot::Slot<Q,MP>::read
  38: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  39: <DB as ra_hir_ty::db::HirDatabase>::trait_impls_in_deps::__shim
  40: ra_hir_ty::traits::chalk::<impl chalk_solve::RustIrDatabase<ra_hir_ty::traits::chalk::interner::Interner> for ra_hir_ty::traits::ChalkContext>::impls_for_trait
  41: chalk_solve::clauses::program_clauses_that_could_match
  42: chalk_solve::clauses::program_clauses_for_goal
  43: chalk_recursive::recursive::Solver<I>::solve_new_subgoal
  44: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  45: <chalk_recursive::recursive::RecursiveSolver<I> as chalk_solve::solve::Solver<I>>::solve_limited
  46: ra_hir_ty::traits::trait_solve_query
  47: salsa::runtime::Runtime::execute_query_implementation
  48: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  49: salsa::derived::slot::Slot<Q,MP>::read
  50: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  51: <DB as ra_hir_ty::db::HirDatabase>::trait_solve::__shim
  52: <DB as ra_hir_ty::db::HirDatabase>::trait_solve
  53: ra_hir_ty::autoderef::deref
  54: <core::iter::sources::Successors<T,F> as core::iter::traits::iterator::Iterator>::next
  55: core::iter::traits::iterator::Iterator::find_map
  56: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  57: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr
  58: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  59: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr
  60: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  61: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  62: ra_hir_ty::infer::infer_query
  63: salsa::runtime::Runtime::execute_query_implementation
  64: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  65: salsa::derived::slot::Slot<Q,MP>::read
  66: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  67: <DB as ra_hir_ty::db::HirDatabase>::infer_query::__shim
  68: ra_hir_ty::db::infer_wait
  69: ra_hir::source_analyzer::SourceAnalyzer::new_for_body
  70: ra_hir::semantics::SemanticsImpl::analyze2
  71: ra_hir::semantics::SemanticsImpl::descend_into_macros
  72: ra_ide::hover::hover
  73: std::panicking::try
  74: ra_ide::Analysis::hover
  75: rust_analyzer::handlers::handle_hover
  76: <F as threadpool::FnBox>::call_box

Installed via xtask from source.

$ git rev-parse HEAD
510866b4a1a812414568bd96f1d197587ead78c0

Metadata

Assignees

No one assigned

    Labels

    A-nameresname, path and module resolutionBroken WindowBugs / technical debt to be addressed immediatelyI-panic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions