Open avandecreme opened 5 months ago
I just started looking into this and got
---- handlers::non_exhaustive_let::tests::regression_issue_17031 stdout ----
thread 'handlers::non_exhaustive_let::tests::regression_issue_17031' panicked at crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs:393:21:
internal error: entered unreachable code: Unexpected type for `Struct` constructor: AssocTypeId(0)<[?0 := AdtId(StructId(StructId(0)))<[]>]>
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
interesting. Seems like a projection issue
Does arbitrary
still emit named const items?🤨 They should really switch to const _
so we can support it properly
It seems not have been so for 2 years 🤔
https://github.com/rust-fuzz/arbitrary/blame/main/derive/src/lib.rs#L57
My test case is generated by proptest_derive, not arbitrary.
Thanks for looking into it!
proptest
has been fixed recently 👍
https://github.com/proptest-rs/proptest/commit/b1be99d2c3225325ef08072ef5f23f231e75a5fa#diff-1e85e98bbdbda751a72c78db697f0e85029d9600354a12d075e081a284f68816L121
Anyway, I'll try fixing the cases like in the example code of this issue
Not sure if something changed recently but I'm getting thread 'Worker' panicked at crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs:401:21:\ninternal error: entered unreachable code: Unexpected type for
Structconstructor: AssocTypeId(8088)
very consistently immediately after opening certain files.
It also seems to happen if I pause while typing a for (a, b
statement. Will try to reproduce.
rust-analyzer version: v0.3.1916 (taken from the VSCode plugin page, the given command does nothing on my machine)
rustc version: 1.76.0 (07dca489a 2024-02-04)
editor or extension: VSCode with rust-analyzer v0.3.1916
relevant settings: NA
repository link (if public, optional): NA
code snippet to reproduce:
This code compiles fine with rustc.
Any of the following changes make the error go away:
_bar
bybar
fn foo(_bar: Self::Bar)
byfn foo(_bar: ())
const foo_impl: () = {...}
wrapperThe original issue for me is when using proptest_derive, I get the error with this code:
The generated code looks similar to the repro above.