File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ future.
38
38
Attempting to use these error numbers on stable will result in the code sample being interpreted as
39
39
plain text.
40
40
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
+
41
50
## Extensions to the ` #[doc] ` attribute
42
51
43
52
These 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
39
39
As a library author, adding the lint ` #![deny(missing_docs)] ` is a great way to
40
40
ensure the project does not drift away from being documented well, and
41
41
` #![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.
45
43
46
44
There are more lints in the upcoming chapter [ Lints] [ rustdoc-lints ] .
47
45
You can’t perform that action at this time.
0 commit comments