Skip to content

index out of bounds: not reproducable #6169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zhiburt opened this issue Oct 7, 2020 · 2 comments
Closed

index out of bounds: not reproducable #6169

zhiburt opened this issue Oct 7, 2020 · 2 comments
Labels
A-nameres name, path and module resolution E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@zhiburt
Copy link

zhiburt commented Oct 7, 2020

thread '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 1', crates/hir_def/src/nameres/path_resolution.rs:283:33
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/gb.xjqchip.workers.dev-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:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   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:217
  10: std::thread::local::LocalKey<T>::with
  11: stdx::panic_context::PanicContext::init::{{closure}}
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:530
  13: rust_begin_unwind
             at src/libstd/panicking.rs:437
  14: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  15: core::panicking::panic_bounds_check
             at src/libcore/panicking.rs:62
  16: hir_def::nameres::path_resolution::<impl hir_def::nameres::CrateDefMap>::resolve_path_fp_with_macro
  17: hir_def::resolver::Resolver::resolve_path_in_type_ns
  18: hir_ty::lower::<impl hir_ty::Ty>::from_hir_ext
  19: <hir_ty::db::ImplSelfTyQuery as salsa::plumbing::QueryFunction>::execute
  20: salsa::runtime::Runtime::execute_query_implementation
  21: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  22: salsa::derived::slot::Slot<Q,MP>::read
  23: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  24: <DB as hir_ty::db::HirDatabase>::impl_self_ty::__shim
  25: <DB as hir_ty::db::HirDatabase>::impl_self_ty
  26: <hir_ty::db::ImplTraitQuery as salsa::plumbing::QueryFunction>::execute
  27: salsa::runtime::Runtime::execute_query_implementation
  28: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  29: salsa::derived::slot::Slot<Q,MP>::maybe_changed_since
  30: hir_ty::db::HirDatabaseGroupStorage__::maybe_changed_since
  31: salsa::derived::slot::MemoRevisions::validate_memoized_value
  32: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  33: salsa::derived::slot::Slot<Q,MP>::read
  34: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  35: <DB as hir_ty::db::HirDatabase>::trait_impls_in_crate::__shim
  36: hir_ty::method_resolution::TraitImpls::trait_impls_in_deps_query
  37: salsa::runtime::Runtime::execute_query_implementation
  38: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  39: salsa::derived::slot::Slot<Q,MP>::read
  40: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  41: <DB as hir_ty::db::HirDatabase>::trait_impls_in_deps::__shim
  42: hir_ty::traits::chalk::<impl chalk_solve::RustIrDatabase<hir_ty::traits::chalk::interner::Interner> for hir_ty::traits::ChalkContext>::impls_for_trait
  43: chalk_solve::clauses::program_clauses_that_could_match
  44: chalk_solve::clauses::program_clauses_for_goal
  45: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  46: <chalk_recursive::recursive::RecursiveSolver<I> as chalk_solve::solve::Solver<I>>::solve_limited
  47: hir_ty::traits::trait_solve_query
  48: salsa::runtime::Runtime::execute_query_implementation
  49: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  50: salsa::derived::slot::Slot<Q,MP>::read
  51: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  52: salsa::QueryTable<Q>::get
  53: <DB as hir_ty::db::HirDatabase>::trait_solve::__shim
  54: <DB as hir_ty::db::HirDatabase>::trait_solve
  55: hir_ty::autoderef::deref
  56: core::iter::traits::iterator::Iterator::find_map
  57: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  58: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  59: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  60: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  61: hir_ty::infer::infer_query
  62: salsa::runtime::Runtime::execute_query_implementation
  63: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  64: salsa::derived::slot::Slot<Q,MP>::read
  65: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  66: <DB as hir_ty::db::HirDatabase>::infer_query::__shim
  67: hir_ty::db::infer_wait
  68: hir_ty::diagnostics::validate_body
  69: hir::code_model::Module::diagnostics
  70: ide::diagnostics::diagnostics
  71: ide::Analysis::diagnostics
  72: rust_analyzer::handlers::publish_diagnostics
  73: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  74: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
  75: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 1', crates/hir_def/src/nameres/path_resolution.rs:283:33
thread '<unnamed>' panicked at 'MacroDef without ast_id', crates/hir/src/has_source.rs:117:37
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/gb.xjqchip.workers.dev-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:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   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:217
  10: std::thread::local::LocalKey<T>::with
  11: stdx::panic_context::PanicContext::init::{{closure}}
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:530
  13: rust_begin_unwind
             at src/libstd/panicking.rs:437
  14: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  15: core::option::expect_failed
             at src/libcore/option.rs:1261
  16: hir::code_model::MacroDef::name
  17: ide_db::defs::Definition::name
  18: ide_db::search::FindUsages::search
  19: ide_db::search::FindUsages::at_least_one
  20: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  21: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
  22: assists::handlers::expand_glob_import::expand_glob_import
  23: assists::Assist::unresolved
  24: ide::Analysis::unresolved_assists
  25: rust_analyzer::handlers::handle_code_action
  26: <F as threadpool::FnBox>::call_box

version: rust-analyzer version: 2020-10-05 (e5f252a)

@zhiburt zhiburt changed the title index out of bounds: the len is 1 but the index is 1 index out of bounds: not reproducable Oct 7, 2020
@matklad matklad added E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Oct 14, 2020
@matklad
Copy link
Member

matklad commented Oct 14, 2020

Probably needs minimal reproducible example to become actionable. But eyeballing the trace might reveal a bug as well!

@jonas-schievink jonas-schievink added the A-nameres name, path and module resolution label Mar 25, 2021
@jonas-schievink
Copy link
Contributor

Same panic location as #5366, so closing as a duplicate. A reproduction is still needed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-nameres name, path and module resolution E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

3 participants