From 6b5eb70e1db79f1fca9f01b6a671e822d6553ccd Mon Sep 17 00:00:00 2001 From: panicbit Date: Fri, 9 Oct 2015 03:00:43 +0200 Subject: [PATCH 1/3] trpl: mention missing_docs lint --- src/doc/trpl/documentation.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/doc/trpl/documentation.md b/src/doc/trpl/documentation.md index 1e1b2e2d4588b..b9de4110a6640 100644 --- a/src/doc/trpl/documentation.md +++ b/src/doc/trpl/documentation.md @@ -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 From 8dfe0ec8a8baf9b964a5be26b63df1c4ff5b2917 Mon Sep 17 00:00:00 2001 From: panicbit Date: Fri, 9 Oct 2015 14:04:45 +0200 Subject: [PATCH 2/3] trpl: missing documentation wording --- src/doc/trpl/documentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/trpl/documentation.md b/src/doc/trpl/documentation.md index b9de4110a6640..abd09a6780352 100644 --- a/src/doc/trpl/documentation.md +++ b/src/doc/trpl/documentation.md @@ -548,8 +548,8 @@ 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 +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`: From cf785d1a9f6a572aba423516ab8541700575fdc2 Mon Sep 17 00:00:00 2001 From: panicbit Date: Fri, 9 Oct 2015 14:08:32 +0200 Subject: [PATCH 3/3] trpl: mention doc(hidden) --- src/doc/trpl/documentation.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/doc/trpl/documentation.md b/src/doc/trpl/documentation.md index abd09a6780352..8cb58ecf2c747 100644 --- a/src/doc/trpl/documentation.md +++ b/src/doc/trpl/documentation.md @@ -571,6 +571,13 @@ leave something undocumented. This is done by using `allow`: 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