summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/wildcard_enum_match_arm.txt
blob: 09807c01c652b9635eefb8c775bf98449fee81f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
### What it does
Checks for wildcard enum matches using `_`.

### Why is this bad?
New enum variants added by library updates can be missed.

### Known problems
Suggested replacements may be incorrect if guards exhaustively cover some
variants, and also may not use correct path to enum if it's not present in the current scope.

### Example
```
match x {
    Foo::A(_) => {},
    _ => {},
}
```

Use instead:
```
match x {
    Foo::A(_) => {},
    Foo::B(_) => {},
}
```