]> git.lizzy.rs Git - rust.git/blob - src/docs/exhaustive_structs.txt
Add iter_kv_map lint
[rust.git] / src / docs / exhaustive_structs.txt
1 ### What it does
2 Warns on any exported `structs`s that are not tagged `#[non_exhaustive]`
3
4 ### Why is this bad?
5 Exhaustive structs are typically fine, but a project which does
6 not wish to make a stability commitment around exported structs may wish to
7 disable them by default.
8
9 ### Example
10 ```
11 struct Foo {
12     bar: u8,
13     baz: String,
14 }
15 ```
16 Use instead:
17 ```
18 #[non_exhaustive]
19 struct Foo {
20     bar: u8,
21     baz: String,
22 }
23 ```