rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.29k stars 1.61k forks source link

thread '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 1' #3956

Closed ChaseElectr closed 4 years ago

ChaseElectr commented 4 years ago

commit: a8e032820f14cad3630299a1ae16c62dcf59f358

thread '' panicked at 'index out of bounds: the len is 1 but the index is 1', /Users/**/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/039fc90/chalk-ir/src/fold/subst.rs:56:19 stack backtrace: 0: ::fmt 1: core::fmt::write 2: std::io::Write::write_fmt 3: std::panicking::default_hook::{{closure}} 4: std::panicking::default_hook 5: std::panicking::rust_panic_with_hook 6: rust_begin_unwind 7: core::panicking::panic_fmt 8: core::panicking::panic_bounds_check 9: <chalk_ir::fold::subst::Subst as chalk_ir::fold::Folder>::fold_free_var_ty 10: <chalk_ir::Ty as chalk_ir::fold::SuperFold<I,TI>>::super_fold_with 11: <chalk_ir::WhereClause as chalk_ir::fold::Fold<I,_TI>>::fold_with 12: chalk_ir::fold::subst::Subst::apply 13: chalk_ir::Binders::substitute 14: chalk_solve::clauses::program_clauses_for_goal 15: <chalk_solve::solve::slg::SlgContextOps as chalk_engine::context::ContextOps<chalk_solve::solve::slg::SlgContext>>::program_clauses 16: chalk_engine::logic::<impl chalk_engine::forest::Forest>::get_or_create_table_for_ucanonical_goal 17: chalk_engine::logic::<impl chalk_engine::forest::Forest>::get_or_create_table_for_subgoal 18: chalk_engine::logic::SolveState<C,CO>::ensure_root_answer 19: chalk_engine::logic::<impl chalk_engine::forest::Forest>::root_answer 20: <chalk_engine::forest::ForestSolver<C,CO> as chalk_engine::context::AnswerStream>::next_answer 21: chalk_solve::solve::slg::aggregate::<impl chalk_engine::context::AggregateOps<chalk_solve::solve::slg::SlgContext> for chalk_solve::solve::slg::SlgContextOps>::make_solution 22: chalk_engine::forest::Forest::solve 23: ra_hir_ty::traits::trait_solve_query 24: salsa::runtime::Runtime::execute_query_implementation 25: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade 26: salsa::derived::slot::Slot<DB,Q,MP>::read 27: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch 28: salsa::QueryTable<DB,Q>::get 29: ::trait_solve 30: ra_hir_ty::method_resolution::iterate_method_candidates_by_receiver 31: ra_hir_ty::method_resolution::iterate_method_candidates 32: ra_hir_ty::infer::expr::::infer_method_call 33: ra_hir_ty::infer::expr::::infer_expr_inner 34: ra_hir_ty::infer::expr::::infer_expr 35: ra_hir_ty::infer::expr::::infer_method_call 36: ra_hir_ty::infer::expr::::infer_expr_inner 37: ra_hir_ty::infer::expr::::infer_expr_coerce 38: ra_hir_ty::infer::expr::::infer_block 39: ra_hir_ty::infer::expr::::infer_expr_inner 40: ra_hir_ty::infer::expr::::infer_expr_coerce 41: ra_hir_ty::infer::expr::::infer_expr_inner 42: ra_hir_ty::infer::expr::::infer_expr_coerce 43: ra_hir_ty::infer::expr::::infer_block 44: ra_hir_ty::infer::expr::::infer_expr_inner 45: ra_hir_ty::infer::expr::::infer_expr_coerce 46: ra_hir_ty::infer::infer_query 47: salsa::runtime::Runtime::execute_query_implementation 48: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade 49: salsa::derived::slot::Slot<DB,Q,MP>::read 50: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch 51: ra_hir_ty::db::infer_wait 52: ra_hir::source_analyzer::SourceAnalyzer::new_for_body 53: ra_hir::semantics::Semantics::analyze2 54: ra_hir::semantics::Semantics::resolve_bind_pat_to_const 55: ra_ide_db::defs::classify_name 56: ra_ide::syntax_highlighting::highlight 57: std::panicking::try::do_call 58: __rust_maybe_catch_panic 59: ra_db::CheckCanceled::catch_canceled 60: ra_ide::Analysis::highlight_range 61: rust_analyzer::main_loop::handlers::handle_semantic_tokens_range 62: ::call_box note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

edwin0cheng commented 4 years ago

duplicated: #3945