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

Panic in `chalk_ir::fold::subst` #16823

Closed Jesse-Bakker closed 8 months ago

Jesse-Bakker commented 8 months ago

rust-analyzer version: Any after a8f56112eab74521dfc75ef811f1a9ea23bcf43c (#16769)

rustc version: rustc 1.76.0 (07dca489a 2024-02-04)

repository link: https://github.com/getdozer/dozer

The panic happens whenever diagnostics are computed for the file dozer-sink-aerospike/src/denorm_dag.rs.

backtrace ``` Panic context: > fetch_native_diagnostics thread 'Worker' panicked at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/fold/subst.rs:55:19 : index out of bounds: the len is 1 but the index is 1 stack backtrace: 0: 0x5cadc09e30e6 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5 1: 0x5cadc09e30e6 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x5cadc09e30e6 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5 3: 0x5cadc09e30e6 - ::fmt::hbb235daedd7c6190 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22 4: 0x5cadc0a141b0 - core::fmt::rt::Argument::fmt::h76c38a80d925a410 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9 5: 0x5cadc0a141b0 - core::fmt::write::h3ed6aeaa977c8e45 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17 6: 0x5cadc09de91f - std::io::Write::write_fmt::h78b18af5775fedb5 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15 7: 0x5cadc09e2ec4 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5 8: 0x5cadc09e2ec4 - std::sys_common::backtrace::print::h85035a511aafe7a8 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9 9: 0x5cadc09e4cb7 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25 10: 0x5cadc09e4a19 - std::panicking::default_hook::hf5fcb0f213fe709a at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9 11: 0x5cadc095fdf4 - as core::ops::function::Fn>::call::h2efdf55e5d11e500 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9 12: 0x5cadc095fdf4 - stdx::panic_context::PanicContext::init::{{closure}}::{{closure}} ::h4a896976e0ed3db7 at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/panic_context.rs:32:17 13: 0x5cadc095fdf4 - stdx::panic_context::with_ctx::{{closure}}::h8997c10eaf44557b at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/panic_context.rs:49:20 14: 0x5cadc095fdf4 - std::thread::local::LocalKey::try_with::hffb693f9da905bec at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/local.rs:270:16 15: 0x5cadc095fdf4 - std::thread::local::LocalKey::with::h140646dc71fc726d at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/local.rs:246:9 16: 0x5cadc09e5346 - as core::ops::function::Fn>::call::hbc5ccf4eb663e1e5 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9 17: 0x5cadc09e5346 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:783:13 18: 0x5cadc09e5092 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13 19: 0x5cadc09e35e6 - std::sys_common::backtrace::__rust_end_short_backtrace::h9259bc2ff8fd0f76 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18 20: 0x5cadc09e4df0 - rust_begin_unwind at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5 21: 0x5cadc0a11475 - core::panicking::panic_fmt::h784f20a50eaab275 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14 22: 0x5cadc0a116b2 - core::panicking::panic_bounds_check::h8331054858f0bf20 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:208:5 23: 0x5cadc04c0e05 - as chalk_ir::fold::TypeFolder>::fold_free_var_ty::h181ff9ec0605d434 at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/fold/subst.rs:55:19 24: 0x5cadc029b2ff - as chalk_ir::fold::TypeSuperFoldable>::try_super_fold_with::hae8351db5071eadc at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/fold.rs:685:21 25: 0x5cadc029b2ff - chalk_ir::fold::TypeSuperFoldable::super_fold_with::h1e224ca0a8b3c60e at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/fold.rs:649:9 26: 0x5cadc028fec3 - as chalk_ir::fold::TypeFoldable>::try_fold_with::h3f4b2adcc4f6ca5a at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/fold.rs:663:9 27: 0x5cadc028fec3 - chalk_ir::_:: for chalk_ir::AliasEq>::try_fold_with:: hdd84526d1e64b0be at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/lib.rs:2017:38 28: 0x5cadc028fec3 - chalk_ir::_:: for chalk_ir::WhereClause>::try_fold_with::h501346564789e21b at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/lib.rs:1722:38 29: 0x5cadc02970f0 - chalk_ir::fold::binder_impls:: for chalk_ir::Binders>::try_fold_with::h91213ed6ae8a4900 at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/fold/binder_impls.rs:45:21 30: 0x5cadc0286f0a - chalk_ir::fold::subst:: Subst::apply::h43aa924a1bf7721f at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/fold/subst.rs:17:9 31: 0x5cadc0286f0a - chalk_ir::Binders::substitute::h16614b7ad46b8288 at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.96.0/src/lib.rs:2231:9 32: 0x5cadc03cefee - hir_ty::infer::path::::add_required_obligations_for_value_path::hcfa0f870a7d4585f at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/path.rs:160:17 33: 0x 5cadc03cefee - hir_ty::infer::path::::infer_path::ha3cd9490afe6a3b3 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/path.rs:35:9 34: 0x5cadc03bc7c3 - hir_ty::infer::expr::::infer_expr_inner::h72c670e7cf638340 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:442:32 35: 0x5cadc03bb1d7 - hir_ty::infer::expr::::infer_expr::h10ac0b23604c8a4c at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:55:18 36: 0x5cadc03bc2f6 - hir_ty::infer::expr::::infer_expr_inner::h72c670e7cf638340 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:313 :33 37: 0x5cadc03c928c - hir_ty::infer::expr::::check_call_arguments::hee2cc53f0895d3c8 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1792:26 38: 0x5cadc03c0f8a - hir_ty::infer::expr:::: infer_expr_inner::h72c670e7cf638340 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:376:17 39: 0x5cadc03bb1d7 - hir_ty::infer::expr::::infer_expr::h10ac0b23604c8a4c at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:55:18 40: 0x5cadc03bc071 - hir_ty::infer::expr::< impl hir_ty::infer::InferenceContext>::infer_expr_inner::h72c670e7cf638340 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:396:32 41: 0x5cadc03bb347 - hir_ty::infer::expr::::infer_expr_coerce::hf871a8b6e46ccc6b at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:75:18 42: 0x5cadc0188be4 - hir_ty::infer::expr::::infer_block::{{closure}}::h463444a5405b5895 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1366:37 43: 0x5cadc0188be4 - hir_ty::infer::expr::::with_breakable_ctx::ha107ace3a407e40e at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:2097:19 44: 0x5cadc03c7285 - hir_ty::infer::expr::::infer_block::h35802995e6c81c82 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1353:13 45: 0x5cadc03bc75d - hir_ty::infer::expr::::infer_expr_inner::h72c670e7cf638340 46: 0x5cadc03bf0d1 - hir_ty::infer::expr::::infer_expr_inner::h72c670e7cf638340 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:430:38 47: 0x5cadc03bb1d7 - hir_ty::infer::expr::::infer_expr::h10ac0b23604c8a4c at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:55:18 48: 0x5cadc0187e35 - hir_ty::infer::expr::::infer_expr_inner::{{closure}}::hcfb559a90779c85c at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:190:25 49: 0x5cadc0187e35 - hir_ty::infer::expr::::with_breakable_ctx::h1b67e24274f59ed2 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:2097: 19 50: 0x5cadc03bd0cb - hir_ty::infer::expr::::infer_expr_inner ::h72c670e7cf638340 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:189:21 51: 0x5cadc03bf0d1 - hir_ty::infer::expr::::infer_expr_inner::h72c670e7cf638340 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:430:38 52: 0x5cadc03bb347 - hir_ty::infer:: expr::::infer_expr_coerce::hf871a8b6e46ccc6b at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:75:18 53: 0x5cadc0188ac1 - hir_ty::infer::expr::::infer_block::{{closure}}::h463444a5405b5895 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1396:33 54: 0x5cadc0188ac1 - hir_ty::infer::expr::::with_breakable_ctx::ha107ace3a407e40e at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:2097:19 55: 0x5cadc03c7285 - hir_ty::infer::expr::::infer_block::h35802995e6c81c82 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1353:13 56: 0x5cadc03bc75d - hir_ty::infer::expr::::infer_expr_inner::h72c670e7cf638340 57: 0x5cadc03c54b8 - hir_ty::infer::expr::::infer_return:: hb73800f3174d277b at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer/expr.rs:1071:30 58: 0x5cadc03d2d4c - hir_ty::infer::InferenceContext:: infer_body::h6ef0c167c6914ab9 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer.rs: 860:24 59: 0x5cadc03d2d4c - hir_ty::infer::infer_query::hbc606e4d90f10ba0 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/infer.rs:128:5 60: 0x5cadc04f097d - ::execute::h1cf27b4d50f66a23 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/db.rs:38:21 61: 0x5cadc04f097d - salsa::derived::slot::Slot::execute::{{closure}}::hf27eb68be3a1540b at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/derived/slot.rs:244:43 62: 0x 5cadc04f097d - as core::ops::function::FnOnce<()>>:: call_once::h2118ff137c4dd385 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panic/unwind_safe.rs:272:9 63: 0x5cadc04f097d - std::panicking::try::do_call::h90d055c8a4b17b08 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs: 552:40 64: 0x5cadc04f097d - std::panicking::try::ha3e5fbcd90235704 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19 65: 0x5cadc04f097d - std::panic::catch_unwind::h88ae23c7709bdb13 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14 66: 0x5cadc04f097d - salsa::Cycle::catch::h83b35af9b84099b5 at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/lib.rs:688:15 67: 0x5cadc0253e00 - salsa::derived::slot::Slot::execute::hc6b58436b9c12234 at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/derived/slot.rs:244:27 68: 0x5cadc0202e13 - salsa::derived ::slot::Slot::read_upgrade::ha2880d3dc956c6c3 at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/derived/slot.rs:222:9 69: 0x5cadc0202e13 - salsa::derived::slot::Slot::read::h08d02aed16f4173e at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/derived/slot.rs:158:9 70: 0x5cadc037b25c - as salsa::plumbing::QueryStorageOps>::fetch::he05746c2685b9daa at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/derived.rs:163:62 71: 0x5cadc017d640 - salsa::QueryTable::get::h8992318b47ea7d4e at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/lib.rs:502:9 72: 0x5cadc017d640 - ::infer_query::__shim::h0035adbfa81ec7de at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/db.rs:32:1 73: 0x5cadc017d1e4 - hir_ty::db::infer_wait::h77a41de90f367be0 at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/db.rs:306:5 74: 0x5cadc00bef88 - hir::DefWithBody::diagnostics::h7a4411550dc3587f at /home/jesse/dev/oss/rust-analyzer/crates/hir/src/lib.rs:1674:21 75: 0x5cadc00b6016 - hir::Module::diagnostics::h6734faa7877cdcce at /home/jesse/dev/oss/rust-analyzer/crates/hir/src/lib.rs:746:17 76: 0x5cadbfc39523 - ide_diagnostics::diagnostics::he4d1812acb1ab3ba at /home/jesse/dev/oss/rust-analyzer/crates/ide-diagnostics/src/lib.rs:329:9 77 : 0x5cadbfa9cf53 - ide::Analysis::diagnostics::{{closure}}::h267fee2c66062d41 at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:652:27 78: 0x5cadbfa9cf53 - ide ::Analysis::with_db::{{closure}}::h4530d9130f559d7e at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:775:29 79: 0x5cadbfa9cf53 - std::panicking::try::do_call::hc137145cf160520a at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40 80: 0x5cadbfa9cf53 - std::panicking::try::hbb6f866077113c4a at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19 81: 0x5cadbfa9cf53 - std::panic::catch_unwind:: h3f8e61a4c2b6a4e4 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14 82: 0x5cadbfa9cf53 - salsa::Cancelled::catch::h6df7eb997b2e836a at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/lib.rs:629:15 83: 0x5cadbfb261f5 - ide::Analysis:: with_db::h4401967ca28785c1 at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:775:9 84: 0x5cadbfa8f70c - ide::Analysis::diagnostics::hbadaa49c2fbc4d8e at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:652:9 85: 0x5cadbf6e6473 - rust_analyzer::diagnostics::fetch_native_diagnostics::{{closure}}::hf5ff6c9b83c2c19a at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs:157:31 86: 0x5cadbf6e6473 - core::ops::function::impls:: for &mut F>::call_mut::hfb5bbdf548b06a0d at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:294:13 87: 0x5cadbf5d4867 - core::iter::traits::iterator::Iterator::find_map ::check::{{closure}}::h94696d4ffaf9952f at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2958:32 88: 0x5cadbf5d4867 - core::iter::adapters::copied::copy_try_fold::{{closure}}::h47d6b3aa5a6fc2d0 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/copied.rs:36:22 89: 0x5cadbf5d4867 - core::iter::traits::iterator::Iterator::try_fold::h7d5d35cb8c6df314 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2462:21 90: 0x5cadbf5d4867 - as core::iter::traits::iterator::Iterator>::try_fold::h81f9c1037ae2c59a at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/copied.rs:70:9 91: 0x5cadbf5d4867 - core::iter::traits::iterator::Iterator::find_map::h6e8990d3c089492d at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2964:9 92: 0x5cadbf5d4867 - as core::iter::traits::iterator::Iterator>::next::h6a55146bd8035164 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/filter_map.rs:63:9 93: 0x5cadbf5d4867 - as alloc::vec::spec_from_iter_nested:: SpecFromIterNested>::from_iter::hed0a194dd4a9c2e1 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/vec/spec_from_iter_nested.rs:26:32 94: 0x5cadbf5d4867 - as alloc::vec::spec_from_iter::SpecFromIter>::from_iter::h1e40a3d6eb95ba4b at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/vec/spec_from_iter.rs:33:9 95: 0x5cadbf7740b2 - as core::iter::traits::collect::FromIterator>::from_iter::h5a47058b2a93d9a6 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/vec/mod.rs:2791:9 96: 0x5cadbf7740b2 - core::iter::traits::iterator::Iterator::collect::h80499f96322fa86a at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2054:9 97: 0x5cadbf7740b2 - rust_analyzer::diagnostics::fetch_native_diagnostics::hf84832a501a147b1 at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs:152 :27 98: 0x5cadbf7d2cbd - rust_analyzer::main_loop::< impl rust_analyzer::global_state::GlobalState>::update_diagnostics::{{closure}}::h60b14bc62b34a89f at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/main_loop.rs:510:39 99: 0x5cadbf7d2cbd - rust_analyzer::task_pool::TaskPool::spawn::{{closure}}::h82f3c00bf4ce6acc at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/task_pool.rs:26:33 100: 0x5cadbf7d2cbd - stdx::thread::pool::Pool::spawn::{{closure}}::ha19c5b24d5c9266d at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/thread/pool.rs:82:13 101: 0x5cadbf7d2cbd - core::ops::function::FnOnce::call_once{{vtable.shim}}:: haaa67dc5ec33554e at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5 102: 0x5cadc0959fe6 - as core::ops::function::FnOnce< Args>>::call_once::h1e06e9ec27a44305 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9 103: 0x5cadc0959fe6 - stdx::thread::pool::Pool::new::{{closure}}::h2ce16c3d197219d5 at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/thread/pool.rs:61:29 104: 0x5cadc0959fe6 - stdx::thread::Builder::spawn::{{closure}}::h127afa68e6998269 at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/thread.rs:66:13 105: 0x5cadc0959fe6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0be81a1552f39324 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18 106 : 0x5cadc0962629 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure} }::ha3316839910111c4 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/mod.rs:529:17 107: 0x5cadc0962629 - as core::ops::function::FnOnce<()>>::call_once::hd871ea900dc266f2 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panic/unwind_safe.rs:272:9 108: 0x5cadc0962629 - std::panicking::try::do_call::he3be10e6d1d7f1f2 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40 109: 0x5cadc0962629 - std::panicking::try::h8d750b6b6a1c2f0f at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516 :19 110: 0x5cadc0962629 - std::panic::catch_unwind::h73f10e3b705841a0 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14 111: 0x5cadc0962629 - std::thread::Builder::spawn_unchecked_:: {{closure}}::h10701b680b31587f at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/mod.rs:528:30 112: 0x5cadc0962629 - core:: ops::function::FnOnce::call_once{{vtable.shim}}::hf15aec3d962d4072 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5 113: 0x5cadc09eb3e5 - as core::ops::function::FnOnce>::call_once::h12de4fc57affb195 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9 114: 0x5cadc09eb3e5 - as core::ops::function::FnOnce>:: call_once::h3c619f45059d5cf1 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs: 2015:9 115: 0x5cadc09eb3e5 - std::sys::unix::thread::Thread::new ::thread_start::hbac657605e4b7389 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys/unix/thread.rs:108:17 116: 0x7a3af711d55a - 117: 0x7a3af719aa3c - 118: 0x0 - ```
Jesse-Bakker commented 8 months ago

Minimized to:

trait Bar {
    type Item;
}

trait Foo { }

fn foo<T: Bar<Item = impl Foo>>(baz: T) {
}

impl Bar for usize {
    type Item = usize;
}

fn main() {
    foo(2)
}

rust-analyzer analysis-stats . crashes while processing main

Jesse-Bakker commented 8 months ago

Panic only happens when associated item is specified using impl-trait syntax. The above function defined as

fn foo<I: Foo, T: Bar<Item = I>>(baz: T) {
}

is completely fine

ShoyuVanilla commented 8 months ago

Maybe my recent PR #16769 is the cause of this, but I was working on other things and seeing this now. I'll debug this too and will leave comments on your PR 🥲