Skip to content

Commit 82bd2c2

Browse files
committed
lint: port missing documentation diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
1 parent 7dffd14 commit 82bd2c2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/rustc_error_messages/locales/en-US/lint.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,5 @@ lint-builtin-export-name-method = declaration of a method with `export_name`
324324
lint-builtin-decl-unsafe-fn = declaration of an `unsafe` function
325325
lint-builtin-decl-unsafe-method = declaration of an `unsafe` method
326326
lint-builtin-impl-unsafe-method = implementation of an `unsafe` method
327+
328+
lint-builtin-missing-doc = missing documentation for {$article} {$desc}

compiler/rustc_lint/src/builtin.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,10 @@ impl MissingDoc {
582582
MISSING_DOCS,
583583
cx.tcx.sess.source_map().guess_head_span(sp),
584584
|lint| {
585-
lint.build(&format!("missing documentation for {} {}", article, desc)).emit();
585+
lint.build(fluent::lint::builtin_missing_doc)
586+
.set_arg("article", article)
587+
.set_arg("desc", desc)
588+
.emit();
586589
},
587590
);
588591
}

0 commit comments

Comments
 (0)