about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-06-28 13:55:12 +0100
committerDavid Wood <david.wood@huawei.com>2022-06-30 08:59:22 +0100
commitdbced105db2b417d40b90a55c4c1a68a4f0ee6aa (patch)
tree8acde3b2079fb51c6c83064451c87efeff946361 /compiler/rustc_lint
parent23ee3e09141fd01ba3ec648123aa319810867c86 (diff)
downloadrust-dbced105db2b417d40b90a55c4c1a68a4f0ee6aa.tar.gz
rust-dbced105db2b417d40b90a55c4c1a68a4f0ee6aa.zip
lint: port unreachable `pub` diagnostic
Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/builtin.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 4787d2ee92a..6c219366291 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -1385,16 +1385,17 @@ impl UnreachablePub {
             }
             let def_span = cx.tcx.sess.source_map().guess_head_span(span);
             cx.struct_span_lint(UNREACHABLE_PUB, def_span, |lint| {
-                let mut err = lint.build(&format!("unreachable `pub` {}", what));
+                let mut err = lint.build(fluent::lint::builtin_unreachable_pub);
+                err.set_arg("what", what);
 
                 err.span_suggestion(
                     vis_span,
-                    "consider restricting its visibility",
+                    fluent::lint::suggestion,
                     "pub(crate)",
                     applicability,
                 );
                 if exportable {
-                    err.help("or consider exporting it for use by other crates");
+                    err.help(fluent::lint::help);
                 }
                 err.emit();
             });