trpl: mention missing_docs lint
This commit is contained in:
parent
11eda66df8
commit
6b5eb70e1d
1 changed files with 25 additions and 0 deletions
|
@ -546,6 +546,31 @@ extern crate foo;
|
|||
pub use foo::bar;
|
||||
```
|
||||
|
||||
## Missing documentation
|
||||
|
||||
Sometimes you want to make sure that every single 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;
|
||||
```
|
||||
|
||||
### Controlling HTML
|
||||
|
||||
You can control a few aspects of the HTML that `rustdoc` generates through the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue