diff options
author | Josh Mcguigan <[email protected]> | 2020-04-05 02:02:27 +0100 |
---|---|---|
committer | Josh Mcguigan <[email protected]> | 2020-04-07 13:12:08 +0100 |
commit | b87b7a088f34ff794fc19e57ee2ae1cfe81a12df (patch) | |
tree | dcfd92910610f457a6ae598068c847bcd49867cc /crates/ra_hir_ty/src/expr.rs | |
parent | 8c378af72117e92bc894fd4a79e978ef0d1c0cc7 (diff) |
remove panics
Diffstat (limited to 'crates/ra_hir_ty/src/expr.rs')
-rw-r--r-- | crates/ra_hir_ty/src/expr.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/expr.rs index 3caeeb394..7498d04dc 100644 --- a/crates/ra_hir_ty/src/expr.rs +++ b/crates/ra_hir_ty/src/expr.rs | |||
@@ -90,9 +90,12 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | match is_useful(&cx, &seen, &PatStack::from_wild()) { | 92 | match is_useful(&cx, &seen, &PatStack::from_wild()) { |
93 | Usefulness::Useful => (), | 93 | Ok(Usefulness::Useful) => (), |
94 | // if a wildcard pattern is not useful, then all patterns are covered | 94 | // if a wildcard pattern is not useful, then all patterns are covered |
95 | Usefulness::NotUseful => return, | 95 | Ok(Usefulness::NotUseful) => return, |
96 | // this path is for unimplemented checks, so we err on the side of not | ||
97 | // reporting any errors | ||
98 | _ => return, | ||
96 | } | 99 | } |
97 | 100 | ||
98 | if let Ok(source_ptr) = source_map.expr_syntax(id) { | 101 | if let Ok(source_ptr) = source_map.expr_syntax(id) { |