WIP: Check uninhabitedness through the trait solver by cjgillot · Pull Request #116247 · rust-lang/rust (original) (raw)
The current implementation with the type InhabitednessPredicate
does not handle well normalization and aliases. This PR proposes to compute uninhabitedness using the trait solver. This allows to handle those seamlessly. This also opens way for a future potential extension to uninhabitedness to coinductive cycles (references to uninhabited for instance).
This implementation is still WIP and clumsy. The logic is duplicated 3 times (once the new solver, twice the old solver). I'm not sure how to reduce that. I'm also very probably using functions that are not compatible with the solvers. It may lack a cycle check somewhere in the old solver.
This also needs a few extra tests.
r? @lcnr