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

panicked at 'index out of bounds: the len is 1 but the index is 1' #4801

Closed fluxxu closed 4 years ago

fluxxu commented 4 years ago

rust-analyzer is extremely slow for one of my projects. It takes minutes react to any code changes. So I tried to run rust-analyzer analysis-stats as suggested here: https://github.com/rust-analyzer/rust-analyzer/issues/4800#issuecomment-640780363 then I caught a panic:

Database loaded, 388 roots, 1.9352077s
Crates in this dir: 51
Total modules found: 343
Total declarations: 4681
Total functions: 1997
Item Collection: 24.313471s, 0b allocated 0b resident
233/1997 11% processing: pagination::countthread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\subst.rs:60:19
stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>
  24: <unknown>
  25: <unknown>
  26: <unknown>
  27: <unknown>
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: <unknown>
  32: <unknown>
  33: <unknown>
  34: <unknown>
  35: <unknown>
  36: <unknown>
  37: <unknown>
  38: <unknown>
  39: <unknown>
  40: <unknown>
  41: <unknown>
  42: <unknown>
  43: <unknown>
  44: <unknown>
  45: <unknown>
  46: <unknown>
  47: <unknown>
  48: <unknown>
  49: <unknown>
  50: <unknown>
  51: <unknown>
  52: <unknown>
  53: <unknown>
  54: <unknown>
  55: <unknown>
  56: <unknown>
  57: <unknown>
  58: BaseThreadInitThunk
  59: RtlUserThreadStart
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Full output with RUST_BACKTRACE=full and CHALK_DEBUG = 2: output.zip

matklad commented 4 years ago

cc @flodiebold

@fluxxu it might be useful to get a full stack trace (building with enabling debug in Cargo.toml).

fluxxu commented 4 years ago
stack backtrace:
   0: backtrace::backtrace::trace_unsynchronized
             at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.44\src\backtrace\mod.rs:66
   1: std::sys_common::backtrace::_print_fmt
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:78
   2: std::sys_common::backtrace::_print::{{impl}}::fmt
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:59
   3: core::fmt::write
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\fmt\mod.rs:1063
   4: std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\io\mod.rs:1426
   5: std::sys_common::backtrace::_print
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:62
   6: std::sys_common::backtrace::print
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:49
   7: std::panicking::default_hook::{{closure}}
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:204
   8: std::panicking::default_hook
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:224
   9: std::panicking::rust_panic_with_hook
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:470
  10: std::panicking::begin_panic_handler
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:378
  11: core::panicking::panic_fmt
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\panicking.rs:85
  12: core::panicking::panic_bounds_check
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\panicking.rs:63
  13: chalk_ir::fold::subst::{{impl}}::fold_free_var_ty<ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\subst.rs:60
  14: chalk_ir::fold::{{impl}}::super_fold_with<ra_hir_ty::traits::chalk::interner::Interner,ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold.rs:410
  15: chalk_ir::fold::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold.rs:383
  16: chalk_ir::_DERIVE_chalk_ir_fold_Fold_I_TI_FOR_GenericArgData::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:1062
  17: chalk_ir::fold::boring_impls::{{impl}}::fold_with<ra_hir_ty::traits::chalk::interner::Interner,ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\boring_impls.rs:128
  18: chalk_ir::fold::boring_impls::{{impl}}::fold_with::{{closure}}
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\boring_impls.rs:148
  19: core::ops::function::impls::{{impl}}::call_once
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\ops\function.rs:285
  20: core::option::Option<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner::Interner>*>::map
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\option.rs:456
  21: core::iter::adapters::{{impl}}::next
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:791
  22: chalk_ir::cast::{{impl}}::next
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\cast.rs:360
  23: core::iter::traits::iterator::Iterator::try_fold
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:1876
  24: core::iter::adapters::{{impl}}::try_fold
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:2701
  25: core::iter::traits::iterator::Iterator::find
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:2174
  26: core::iter::adapters::{{impl}}::next
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:2683
  27: alloc::vec::Vec<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner::Interner>>::extend_desugared
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:2138
  28: alloc::vec::{{impl}}::spec_extend
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:2031
  29: alloc::vec::{{impl}}::from_iter<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner::Interner>,core::iter::adapters::ResultShunt<chalk_ir::cast::Casted<core::iter::adapters::Map<core::slice::Iter<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:2026
  30: alloc::vec::{{impl}}::from_iter
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:1926
  31: core::iter::traits::iterator::Iterator::collect
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:1659
  32: core::result::{{impl}}::from_iter::{{closure}}
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\result.rs:1503
  33: core::iter::adapters::process_results
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:2672
  34: core::result::{{impl}}::from_iter
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\result.rs:1503
  35: core::iter::traits::iterator::Iterator::collect
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:1659
  36: ra_hir_ty::traits::chalk::interner::{{impl}}::intern_substitution
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\traits\chalk\interner.rs:272
  37: chalk_ir::Substitution<ra_hir_ty::traits::chalk::interner::Interner>::from_fallible
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:2260
  38: chalk_ir::fold::boring_impls::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\boring_impls.rs:149
  39: chalk_ir::_DERIVE_chalk_ir_fold_Fold_I_TI_FOR_ProjectionTy::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:1148
  40: chalk_ir::_DERIVE_chalk_ir_fold_Fold_I_TI_FOR_AliasTy::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:1124
  41: chalk_ir::fold::{{impl}}::super_fold_with<ra_hir_ty::traits::chalk::interner::Interner,ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold.rs:424
  42: chalk_ir::fold::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold.rs:383
  43: chalk_ir::_DERIVE_chalk_ir_fold_Fold_I_TI_FOR_GenericArgData::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:1062
  44: chalk_ir::fold::boring_impls::{{impl}}::fold_with<ra_hir_ty::traits::chalk::interner::Interner,ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\boring_impls.rs:128
  45: chalk_ir::fold::boring_impls::{{impl}}::fold_with::{{closure}}
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\boring_impls.rs:148
  46: core::ops::function::impls::{{impl}}::call_once
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\ops\function.rs:285
  47: core::option::Option<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner::Interner>*>::map
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\option.rs:456
  48: core::iter::adapters::{{impl}}::next
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:791
  49: chalk_ir::cast::{{impl}}::next
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\cast.rs:360
  50: core::iter::traits::iterator::Iterator::try_fold
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:1876
  51: core::iter::adapters::{{impl}}::try_fold
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:2701
  52: core::iter::traits::iterator::Iterator::find
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:2174
  53: core::iter::adapters::{{impl}}::next
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:2683
  54: alloc::vec::Vec<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner::Interner>>::extend_desugared
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:2138
  55: alloc::vec::{{impl}}::spec_extend
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:2031
  56: alloc::vec::{{impl}}::from_iter<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner::Interner>,core::iter::adapters::ResultShunt<chalk_ir::cast::Casted<core::iter::adapters::Map<core::slice::Iter<chalk_ir::GenericArg<ra_hir_ty::traits::chalk::interner
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:2026
  57: alloc::vec::{{impl}}::from_iter
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\liballoc\vec.rs:1926
  58: core::iter::traits::iterator::Iterator::collect
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:1659
  59: core::result::{{impl}}::from_iter::{{closure}}
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\result.rs:1503
  60: core::iter::adapters::process_results
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\adapters\mod.rs:2672
  61: core::result::{{impl}}::from_iter
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\result.rs:1503
  62: core::iter::traits::iterator::Iterator::collect
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\src\libcore\iter\traits\iterator.rs:1659
  63: ra_hir_ty::traits::chalk::interner::{{impl}}::intern_substitution
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\traits\chalk\interner.rs:272
  64: chalk_ir::Substitution<ra_hir_ty::traits::chalk::interner::Interner>::from_fallible
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:2260
  65: chalk_ir::fold::boring_impls::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\boring_impls.rs:149
  66: chalk_ir::_DERIVE_chalk_ir_fold_Fold_I_TI_FOR_ApplicationTy::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:928
  67: chalk_ir::fold::{{impl}}::super_fold_with<ra_hir_ty::traits::chalk::interner::Interner,ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold.rs:421
  68: chalk_ir::fold::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold.rs:383
  69: chalk_ir::_DERIVE_chalk_ir_fold_Fold_I_TI_FOR_AliasEq::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:1467
  70: chalk_ir::_DERIVE_chalk_ir_fold_Fold_I_TI_FOR_WhereClause::{{impl}}::fold_with<ra_hir_ty::traits::chalk::interner::Interner,ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:1193
  71: chalk_ir::fold::binder_impls::{{impl}}::fold_with
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\binder_impls.rs:51
  72: chalk_ir::fold::boring_impls::{{impl}}::fold_with<chalk_ir::Binders<chalk_ir::WhereClause<ra_hir_ty::traits::chalk::interner::Interner>>,ra_hir_ty::traits::chalk::interner::Interner,ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\boring_impls.rs:23
  73: chalk_ir::fold::subst::Subst<ra_hir_ty::traits::chalk::interner::Interner>::apply
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\fold\subst.rs:18
  74: chalk_ir::Binders<chalk_ir::Binders<chalk_ir::WhereClause<ra_hir_ty::traits::chalk::interner::Interner>>*>::substitute<chalk_ir::Binders<chalk_ir::WhereClause<ra_hir_ty::traits::chalk::interner::Interner>>*,ra_hir_ty::traits::chalk::interner::Interner,cha
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-ir-0.11.0\src\lib.rs:1653
  75: chalk_solve::clauses::program_clauses::{{impl}}::to_program_clauses::{{closure}}
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-solve-0.11.0\src\clauses\program_clauses.rs:173
  76: chalk_solve::clauses::builder::ClauseBuilder<ra_hir_ty::traits::chalk::interner::Interner>::push_binders<ra_hir_ty::traits::chalk::interner::Interner,chalk_solve::rust_ir::OpaqueTyDatumBound<ra_hir_ty::traits::chalk::interner::Interner>,closure-0>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-solve-0.11.0\src\clauses\builder.rs:137
  77: chalk_solve::clauses::program_clauses::{{impl}}::to_program_clauses<ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-solve-0.11.0\src\clauses\program_clauses.rs:133
  78: chalk_solve::clauses::program_clauses_for_goal<ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-solve-0.11.0\src\clauses.rs:189
  79: chalk_solve::recursive::Solver<ra_hir_ty::traits::chalk::interner::Interner>::solve_goal<ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-solve-0.11.0\src\recursive.rs:168
  80: chalk_solve::recursive::Solver<ra_hir_ty::traits::chalk::interner::Interner>::solve_root_goal<ra_hir_ty::traits::chalk::interner::Interner>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-solve-0.11.0\src\recursive.rs:110
  81: chalk_solve::solve::Solver<ra_hir_ty::traits::chalk::interner::Interner>::solve_limited
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-solve-0.11.0\src\solve.rs:367
  82: ra_hir_ty::traits::solve::{{closure}}
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\traits.rs:199
  83: ra_hir_ty::traits::solve
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\traits.rs:206
  84: ra_hir_ty::traits::trait_solve_query
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\traits.rs:174
  85: salsa::runtime::Runtime<ra_ide_db::RootDatabase>::execute_query_implementation<ra_ide_db::RootDatabase,core::option::Option<ra_hir_ty::traits::Solution>,closure-1>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\salsa-0.14.1\src\runtime.rs:352
  86: salsa::derived::slot::Slot<ra_ide_db::RootDatabase, ra_hir_ty::db::TraitSolveQuery, salsa::derived::AlwaysMemoizeValue>::read_upgrade<ra_ide_db::RootDatabase,ra_hir_ty::db::TraitSolveQuery,salsa::derived::AlwaysMemoizeValue>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\salsa-0.14.1\src\derived\slot.rs:217
  87: salsa::derived::slot::Slot<ra_ide_db::RootDatabase, ra_hir_ty::db::TraitSolveQuery, salsa::derived::AlwaysMemoizeValue>::read<ra_ide_db::RootDatabase,ra_hir_ty::db::TraitSolveQuery,salsa::derived::AlwaysMemoizeValue>    
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\salsa-0.14.1\src\derived\slot.rs:149
  88: salsa::derived::{{impl}}::try_fetch<ra_ide_db::RootDatabase,ra_hir_ty::db::TraitSolveQuery,salsa::derived::AlwaysMemoizeValue>
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\salsa-0.14.1\src\derived.rs:140
  89: salsa::QueryTable<ra_ide_db::RootDatabase, ra_hir_ty::db::TraitSolveQuery>::try_get
             at C:\Users\fluxx\.cargo\registry\src\github.com-1ecc6299db9ec823\salsa-0.14.1\src\lib.rs:483
  90: salsa::QueryTable<ra_ide_db::RootDatabase, ra_hir_ty::db::TraitSolveQuery>::get<ra_ide_db::RootDatabase,ra_hir_ty::db::TraitSolveQuery>
  91: ra_hir_ty::db::{{impl}}::trait_solve<ra_ide_db::RootDatabase>
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\db.rs:21
  92: ra_hir_ty::infer::InferenceContext::resolve_obligations_as_possible
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer.rs:328
  93: ra_hir_ty::infer::InferenceContext::resolve_ty_as_possible
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer.rs:358
  94: ra_hir_ty::infer::InferenceContext::resolve_associated_type_with_params
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer.rs:391
  95: ra_hir_ty::infer::InferenceContext::resolve_associated_type
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer.rs:368
  96: ra_hir_ty::infer::InferenceContext::infer_expr_inner
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer\expr.rs:360
  97: ra_hir_ty::infer::InferenceContext::infer_expr
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer\expr.rs:31
  98: ra_hir_ty::infer::InferenceContext::infer_method_call
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer\expr.rs:668
  99: ra_hir_ty::infer::InferenceContext::infer_expr_inner
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer\expr.rs:213
 100: ra_hir_ty::infer::InferenceContext::infer_expr_inner
             at C:\Data\Projects\rust-analyzer\crates\ra_hir_ty\src\infer\expr.rs:363
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@matklad done

flodiebold commented 4 years ago

From the Chalk log, it seems there's a variable index off in an impl Trait type, something looking like impl Future<Output = Result<Option<i32, <??? as ConnectionSpec<???>>::Error>. It looks like it could very well be the same problem as #4800.

flodiebold commented 4 years ago

Please retest once #4952 is merged.

fluxxu commented 4 years ago

I tested the latest master branch... It does fix the panic caused by pagination::count function, but not rust-analyzer.exe hangs forever on another function...

PS C:\Data\Projects\rust-analyzer\target\release> .\rust-analyzer.exe analysis-stats C:\Data\Projects\bs-core
Database loaded, 402 roots, 1.9757539s
Crates in this dir: 49
Total modules found: 385
Total declarations: 6147
Total functions: 2558
Item Collection: 27.1360472s, 0b allocated 0b resident
749/2558 29% processing: client::model::count

I'll open another issue.