Rollup merge of #67026 - Nadrieril:improve-usefulness-empty, r=varkor,Centril,estebank
Improve diagnostics and code for exhaustiveness of empty matches There was a completely separate check and diagnostics for the case of an empty match. This led to slightly different error messages and duplicated code. This improves code reuse and generally clarifies what happens for empty matches. This also clarifies the action of the `exhaustive_patterns` feature, and ensures that this feature doesn't change diagnostics in places it doesn't need to.
This commit is contained in:
commit
df9e491fb2
20 changed files with 889 additions and 182 deletions
|
|
@ -1,8 +1,8 @@
|
|||
error[E0004]: non-exhaustive patterns: multiple patterns of type `std::option::Option<i32>` are not handled
|
||||
error[E0004]: non-exhaustive patterns: `None` and `Some(_)` not covered
|
||||
--> $DIR/E0004-2.rs:4:11
|
||||
|
|
||||
LL | match x { }
|
||||
| ^
|
||||
| ^ patterns `None` and `Some(_)` not covered
|
||||
|
|
||||
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue