remove panics

This commit is contained in:
Josh Mcguigan 2020-04-04 18:02:27 -07:00
parent 8c378af721
commit b87b7a088f
2 changed files with 213 additions and 65 deletions

View file

@ -90,9 +90,12 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
}
match is_useful(&cx, &seen, &PatStack::from_wild()) {
Usefulness::Useful => (),
Ok(Usefulness::Useful) => (),
// if a wildcard pattern is not useful, then all patterns are covered
Usefulness::NotUseful => return,
Ok(Usefulness::NotUseful) => return,
// this path is for unimplemented checks, so we err on the side of not
// reporting any errors
_ => return,
}
if let Ok(source_ptr) = source_map.expr_syntax(id) {