File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ future.
3838Attempting to use these error numbers on stable will result in the code sample being interpreted as
3939plain text.
4040
41+ ### ` missing_doc_code_examples ` lint
42+
43+ This lint will emit a warning if an item doesn't have a code example in its documentation.
44+ It can be enabled using:
45+
46+ ``` rust,ignore (nightly)
47+ #![deny(rustdoc::missing_doc_code_examples)]
48+ ```
49+
4150## Extensions to the ` #[doc] ` attribute
4251
4352These features operate by extending the ` #[doc] ` attribute, and thus can be caught by the compiler
Original file line number Diff line number Diff line change @@ -39,9 +39,7 @@ warning: 1 warning emitted
3939As a library author, adding the lint ` #![deny(missing_docs)] ` is a great way to
4040ensure the project does not drift away from being documented well, and
4141` #![warn(missing_docs)] ` is a good way to move towards comprehensive
42- documentation. In addition to docs, ` #![deny(rustdoc::missing_doc_code_examples)] `
43- ensures each function contains a usage example. In our example above, the
44- warning is resolved by adding crate level documentation.
42+ documentation.
4543
4644There are more lints in the upcoming chapter [ Lints] [ rustdoc-lints ] .
4745
You can’t perform that action at this time.
0 commit comments