diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-30 13:28:41 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-30 16:49:37 +0200 |
| commit | b85fcf51d2a08a362fbcca69b9d61316873a3171 (patch) | |
| tree | 72b45264678f122a5817d1e089cd1bbd5dcb9505 | |
| parent | cdc4fa45896c2b086646c8c9c91adb8d9dc5e45f (diff) | |
| download | rust-b85fcf51d2a08a362fbcca69b9d61316873a3171.tar.gz rust-b85fcf51d2a08a362fbcca69b9d61316873a3171.zip | |
Remove mention of `missing_doc_code_examples` lint from rustdoc book
| -rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 9 | ||||
| -rw-r--r-- | src/doc/rustdoc/src/write-documentation/what-to-include.md | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index b8b5014ab42..1f9133aef12 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -38,6 +38,15 @@ future. Attempting to use these error numbers on stable will result in the code sample being interpreted as plain text. +### `missing_doc_code_examples` lint + +This lint will emit a warning if an item doesn't have a code example in its documentation. +It can be enabled using: + +```rust,ignore (nightly) +#![deny(rustdoc::missing_doc_code_examples)] +``` + ## Extensions to the `#[doc]` attribute These features operate by extending the `#[doc]` attribute, and thus can be caught by the compiler diff --git a/src/doc/rustdoc/src/write-documentation/what-to-include.md b/src/doc/rustdoc/src/write-documentation/what-to-include.md index cf1e6a8d3ca..16457ed0ff8 100644 --- a/src/doc/rustdoc/src/write-documentation/what-to-include.md +++ b/src/doc/rustdoc/src/write-documentation/what-to-include.md @@ -39,9 +39,7 @@ warning: 1 warning emitted As a library author, adding the lint `#![deny(missing_docs)]` is a great way to ensure the project does not drift away from being documented well, and `#![warn(missing_docs)]` is a good way to move towards comprehensive -documentation. In addition to docs, `#![deny(rustdoc::missing_doc_code_examples)]` -ensures each function contains a usage example. In our example above, the -warning is resolved by adding crate level documentation. +documentation. There are more lints in the upcoming chapter [Lints][rustdoc-lints]. |
