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 11:27:26 +0100
committerDavid Wood <david.wood@huawei.com>2022-06-30 08:59:22 +0100
commit284ec37810f7d93cee6fd0a177220fc55afb7755 (patch)
treecd2b6dde28d3138e8be61242c70e0ce79e85b9ee /compiler/rustc_lint
parent28655bc95537efa467dde736b9c1ded59b95b564 (diff)
downloadrust-284ec37810f7d93cee6fd0a177220fc55afb7755.tar.gz
rust-284ec37810f7d93cee6fd0a177220fc55afb7755.zip
lint: port missing debug impl diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/builtin.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index c33e9561c1a..82b283ad4b5 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -857,12 +857,9 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations {
 
         if !self.impling_types.as_ref().unwrap().contains(&item.def_id) {
             cx.struct_span_lint(MISSING_DEBUG_IMPLEMENTATIONS, item.span, |lint| {
-                lint.build(&format!(
-                    "type does not implement `{}`; consider adding `#[derive(Debug)]` \
-                     or a manual implementation",
-                    cx.tcx.def_path_str(debug)
-                ))
-                .emit();
+                lint.build(fluent::lint::builtin_missing_debug_impl)
+                    .set_arg("debug", cx.tcx.def_path_str(debug))
+                    .emit();
             });
         }
     }