Closed Jesse-Bakker closed 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
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
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 🥲
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 -