diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-22 12:18:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-22 12:18:38 +0200 |
| commit | 91ef66374bf403e1f0c3fe9c0f9db9941898c045 (patch) | |
| tree | 3efac0cb13e9236db63992d5947cfe3c83a248e3 /src | |
| parent | e7c5334a887f9218a7c2397910b1c27737760c79 (diff) | |
| parent | 3a8097f2b44f8221bfbdbf47b66558eca44953fd (diff) | |
Rollup merge of #71412 - dtolnay:uselessdoc, r=Manishearth
Clarify unused_doc_comments note on macro invocations The previous error message used to say: <pre> /// doc ^^^^^^^ rustdoc does not generate documentation for <b>macros</b> </pre> Obviously we do generate documentation for macros, such as https://docs.rs/bitflags/1.2.1/bitflags/macro.bitflags.html. It's only macro invocations that don't get their own docs. This PR updates the message to say "rustdoc does not generate documentation for <b>macro invocations</b>". I observe that prior to #69084 this used to say "rustdoc does not generate documentation for **macro expansions**", as implemented originally in #57882. I don't have a preference between those but I made the commit before looking up the history. r? @Manishearth attn: @yaahc @euclio
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_lint/context.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/useless-comment.stderr | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_lint/context.rs b/src/librustc_lint/context.rs index 1747a78d36a..e5d3227d5af 100644 --- a/src/librustc_lint/context.rs +++ b/src/librustc_lint/context.rs @@ -566,7 +566,7 @@ pub trait LintContext: Sized { stability::deprecation_suggestion(&mut db, suggestion, span) } BuiltinLintDiagnostics::UnusedDocComment(span) => { - db.span_label(span, "rustdoc does not generate documentation for macros"); + db.span_label(span, "rustdoc does not generate documentation for macro invocations"); db.help("to document an item produced by a macro, \ the macro must produce the documentation as part of its expansion"); } diff --git a/src/test/ui/useless-comment.stderr b/src/test/ui/useless-comment.stderr index 92817321a88..5a0af8db7c5 100644 --- a/src/test/ui/useless-comment.stderr +++ b/src/test/ui/useless-comment.stderr @@ -2,7 +2,7 @@ error: unused doc comment --> $DIR/useless-comment.rs:9:1 | LL | /// foo - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustdoc does not generate documentation for macros + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustdoc does not generate documentation for macro invocations | note: the lint level is defined here --> $DIR/useless-comment.rs:3:9 @@ -15,7 +15,7 @@ error: unused doc comment --> $DIR/useless-comment.rs:32:5 | LL | /// bar - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustdoc does not generate documentation for macros + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustdoc does not generate documentation for macro invocations | = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion |
