Adding a specialized impl can break inference. #46363
Labels
A-inference
Area: Type inference
C-bug
Category: This is a bug.
F-specialization
`#![feature(specialization)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Relevant to #31844. This is how it happens:
This issue does not originate from specialization, since if we removed
Impl 1
the same problem would occur. But with specialization if those impls were added in order, the story would be a bit confusing:Impl 1
, inference fails.Impl 2
, yay inference succeeds.Impl 3
, inference is back to failing.The only fix would be to make inference fail in step 2. Even if it's not something we want fix it still seems worth noting somewhere that we are ok with specializaton breaking inference.
The text was updated successfully, but these errors were encountered: