Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trpl: mention missing_docs lint #28922

Merged
merged 3 commits into from
Oct 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/doc/trpl/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down