typeck: diverging binding in pattern does not generate unreachable_code #68429
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following should probably result in the lint being emitted:
as
_never
is matched on, and it has a diverging type.Compare this with:
Currently, the pattern type checking code does not care about
diverges
.We should probably avoid fixing this in typeck and have this be fixed automatically (?) by moving
diverges
logic to MIR or some such.cc @eddyb #68422 (comment).
The text was updated successfully, but these errors were encountered: