typecheck_ice when attempting to type check trait object with duplicate associated types #81809
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Link to gist
Meta
rustc --version --verbose
:Error output
Backtrace
I did my best to create a small example for this, and I think this is a minimal instance of the problem. Looks like there is an error when trying to type check a cast to
&dyn StoreIndex
, for which the super traits expand to&dyn Index<u8, Output=Foo> + Index<u16, Output=Bar>
which the typechecker seems to have issue by considering both constraints onOutput
regardless of theT
indexing type (asStoreIndex<Output = Bar, Output = Foo>
which it considers unsolvable sinceBar != Foo
.The other two cases here are interesting as well. When
get()
is used directly, type checking fails but there is no ICE, but when theVec<Store>
is indexed directly&Store
is automatically cast to&dyn StoreIndex
and compilation succeeds.The text was updated successfully, but these errors were encountered: