Skip to content

Commit 6b5eb70

Browse files
committed
trpl: mention missing_docs lint
1 parent 11eda66 commit 6b5eb70

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/doc/trpl/documentation.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,31 @@ extern crate foo;
546546
pub use foo::bar;
547547
```
548548

549+
## Missing documentation
550+
551+
Sometimes you want to make sure that every single thing in your project is
552+
documented, especially when you are working on a library. Rust allows you to
553+
to generate warnings or errors, when an item is missing documentation.
554+
To generate warnings you use `warn`:
555+
556+
```rust
557+
#![warn(missing_docs)]
558+
```
559+
560+
And to generate errors you use `deny`:
561+
562+
```rust,ignore
563+
#![deny(missing_docs)]
564+
```
565+
566+
There are cases where you want to disable these warnings/errors to explicitly
567+
leave something undocumented. This is done by using `allow`:
568+
569+
```rust
570+
#[allow(missing_docs)]
571+
struct Undocumented;
572+
```
573+
549574
### Controlling HTML
550575

551576
You can control a few aspects of the HTML that `rustdoc` generates through the

0 commit comments

Comments
 (0)