Specific error message when trying to exhaustively match on pointer types #65712
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
As the title suggests, exhaustive pattern checking for
usize
andisize
fails when checks for similar patterns for{i,u}{n}
succeed. Consider the following program (playground link):While checking succeeds for
g
(u8
) andj
(i32
), it fails forf
(usize
) andh
(isize
).cc @varkor
This is intentional (exhaustive matching on pointers is tracked at #56354), but where we would exhaustively match, then we could suggest using
#![feature(precise_pointer_size_matching)]
and explain why the pattern wasn't exhaustively matched.The text was updated successfully, but these errors were encountered: