Commit 6bed383
committed
diagnostics: emit
When a doc comment is nested within an item:
fn foo() {
/// doc comment
fn bar() {}
}
When that happens, emit a warning, because they aren't rendered, even
with --document-private-items
warning: unused doc comment
--> src/lib.rs:3:3
|
3 | /// nested fn
| ^^^^^^^^^^^^^
4 | pub fn bar() {
| -------------- rustdoc does not generate documentation for items defined in functions
|
= help: use `//` for a plain comment
= note: `#[warn(unused_doc_comments)]` (part of `#[warn(unused)]`) on by defaultunused_doc_comments on fn nest1 parent 8b95a26 commit 6bed383
3 files changed
Lines changed: 33 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
841 | 867 | | |
842 | 868 | | |
843 | 869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
3341 | 3341 | | |
3342 | 3342 | | |
3343 | 3343 | | |
3344 | | - | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
3345 | 3349 | | |
3346 | 3350 | | |
3347 | 3351 | | |
| |||
0 commit comments