summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/exhaustive_structs.txt
blob: fd6e4f5caf1f257b04d4f0712b064fe44eb40ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
### What it does
Warns on any exported `structs`s that are not tagged `#[non_exhaustive]`

### Why is this bad?
Exhaustive structs are typically fine, but a project which does
not wish to make a stability commitment around exported structs may wish to
disable them by default.

### Example
```
struct Foo {
    bar: u8,
    baz: String,
}
```
Use instead:
```
#[non_exhaustive]
struct Foo {
    bar: u8,
    baz: String,
}
```