rollup merge of #18990: alfie/master
This commit is contained in:
commit
b22afe9ee7
1 changed files with 1 additions and 1 deletions
|
@ -95,7 +95,7 @@ code should need to run is a stack.
|
|||
`match` being exhaustive has some useful properties. First, if every
|
||||
possibility is covered by the `match`, adding further variants to the `enum`
|
||||
in the future will prompt a compilation failure, rather than runtime panic.
|
||||
Second, it makes cost explicit. In general, only safe way to have a
|
||||
Second, it makes cost explicit. In general, the only safe way to have a
|
||||
non-exhaustive match would be to panic the task if nothing is matched, though
|
||||
it could fall through if the type of the `match` expression is `()`. This sort
|
||||
of hidden cost and special casing is against the language's philosophy. It's
|
||||
|
|
Loading…
Add table
Reference in a new issue