Improve error message for uninhabited patterns

This commit is contained in:
Ayaz Hafiz 2022-09-19 10:55:02 -05:00
parent 147636f42b
commit 0f0e414272
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 64 additions and 40 deletions

View file

@ -92,14 +92,12 @@ pub enum Error {
overall_region: Region,
branch_region: Region,
index: HumanIndex,
reason: RedundantReason,
},
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RedundantReason {
PreviouslyCovered,
Uninhabited,
Unmatchable {
overall_region: Region,
branch_region: Region,
index: HumanIndex,
},
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]