diff options
| author | bors <bors@rust-lang.org> | 2015-10-10 14:51:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-10 14:51:42 +0000 |
| commit | e3cd87241898cd88e4348e9c6142a03d8909c4e0 (patch) | |
| tree | ef47e53929e74f1a973d5258119329f5516b8c97 | |
| parent | e6abcbcb210dd567e90736e22a265454a5ced81a (diff) | |
| parent | cf785d1a9f6a572aba423516ab8541700575fdc2 (diff) | |
| download | rust-e3cd87241898cd88e4348e9c6142a03d8909c4e0.tar.gz rust-e3cd87241898cd88e4348e9c6142a03d8909c4e0.zip | |
Auto merge of #28922 - panicbit:trpl-missing-docs, r=steveklabnik
| -rw-r--r-- | src/doc/trpl/documentation.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/doc/trpl/documentation.md b/src/doc/trpl/documentation.md index 1e1b2e2d458..8cb58ecf2c7 100644 --- a/src/doc/trpl/documentation.md +++ b/src/doc/trpl/documentation.md @@ -546,6 +546,38 @@ extern crate foo; pub use foo::bar; ``` +## Missing documentation + +Sometimes you want to make sure that every single public thing in your project +is documented, especially when you are working on a library. Rust allows you to +to generate warnings or errors, when an item is missing documentation. +To generate warnings you use `warn`: + +```rust +#![warn(missing_docs)] +``` + +And to generate errors you use `deny`: + +```rust,ignore +#![deny(missing_docs)] +``` + +There are cases where you want to disable these warnings/errors to explicitly +leave something undocumented. This is done by using `allow`: + +```rust +#[allow(missing_docs)] +struct Undocumented; +``` + +You might even want to hide items from the documentation completely: + +```rust +#[doc(hidden)] +struct Hidden; +``` + ### Controlling HTML You can control a few aspects of the HTML that `rustdoc` generates through the |
