diff options
| author | David Wood <david.wood@huawei.com> | 2022-06-28 13:35:33 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-06-30 08:59:22 +0100 |
| commit | a13b70ea83f1f3781cba2dbdc990520bdbb6a740 (patch) | |
| tree | e80c8fa46c2493396be4b6d9c9f13b9b5e1c11ce /compiler/rustc_lint | |
| parent | e151d66343788875c039a13dad8e3e90831565c1 (diff) | |
| download | rust-a13b70ea83f1f3781cba2dbdc990520bdbb6a740.tar.gz rust-a13b70ea83f1f3781cba2dbdc990520bdbb6a740.zip | |
lint: port unused doc comment diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_lint')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 147c4e94326..a31936f376a 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1039,17 +1039,15 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: & if is_doc_comment || attr.has_name(sym::doc) { cx.struct_span_lint(UNUSED_DOC_COMMENTS, span, |lint| { - let mut err = lint.build("unused doc comment"); - err.span_label( - node_span, - format!("rustdoc does not generate documentation for {}", node_kind), - ); + let mut err = lint.build(fluent::lint::builtin_unused_doc_comment); + err.set_arg("kind", node_kind); + err.span_label(node_span, fluent::lint::label); match attr.kind { AttrKind::DocComment(CommentKind::Line, _) | AttrKind::Normal(..) => { - err.help("use `//` for a plain comment"); + err.help(fluent::lint::plain_help); } AttrKind::DocComment(CommentKind::Block, _) => { - err.help("use `/* */` for a plain comment"); + err.help(fluent::lint::block_help); } } err.emit(); |
