Skip to content

Commit e3cd872

Browse files
committed
Auto merge of #28922 - panicbit:trpl-missing-docs, r=steveklabnik
2 parents e6abcbc + cf785d1 commit e3cd872

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/doc/trpl/documentation.md

+32
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,38 @@ extern crate foo;
546546
pub use foo::bar;
547547
```
548548

549+
## Missing documentation
550+
551+
Sometimes you want to make sure that every single public thing in your project
552+
is 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+
574+
You might even want to hide items from the documentation completely:
575+
576+
```rust
577+
#[doc(hidden)]
578+
struct Hidden;
579+
```
580+
549581
### Controlling HTML
550582

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

0 commit comments

Comments
 (0)