summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/needless_doctest_main.txt
blob: 8f91a7baa71510617ff72d15f710716b612a46ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
### What it does
Checks for `fn main() { .. }` in doctests

### Why is this bad?
The test can be shorter (and likely more readable)
if the `fn main()` is left implicit.

### Examples
```
/// An example of a doctest with a `main()` function
///
/// # Examples
///
/// ```
/// fn main() {
///     // this needs not be in an `fn`
/// }
/// ```
fn needless_main() {
    unimplemented!();
}
```