about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2023-04-29 15:47:23 +0000
committerDeadbeef <ent3rm4n@gmail.com>2023-04-29 15:47:23 +0000
commit475378f0c6fb6261fd73b54a902a2d7d55ee47cb (patch)
treef9aa4d25fe73c25d4efac0f97d2d3486ece8e271
parente92806704b088471a3ced0a7dcc2aa46c99e1366 (diff)
downloadrust-475378f0c6fb6261fd73b54a902a2d7d55ee47cb.tar.gz
rust-475378f0c6fb6261fd73b54a902a2d7d55ee47cb.zip
add match to diagnostic messages
-rw-r--r--compiler/rustc_lint/messages.ftl7
-rw-r--r--compiler/rustc_lint/src/noop_method_call.rs6
2 files changed, 9 insertions, 4 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl
index 0cef6a44b07..71cf644eb50 100644
--- a/compiler/rustc_lint/messages.ftl
+++ b/compiler/rustc_lint/messages.ftl
@@ -51,7 +51,12 @@ lint_renamed_or_removed_lint = {$msg}
     .suggestion = use the new name
 
 lint_suspicious_double_ref_op =
-    using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op} the inner type
+    using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op ->
+        *[should_not_happen] [{$op}]
+        [deref] dereferencing
+        [borrow] borrowing
+        [clone] cloning
+    } the inner type
 
 lint_unknown_lint =
     unknown lint: `{$name}`
diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs
index 648c0c26404..d054966459d 100644
--- a/compiler/rustc_lint/src/noop_method_call.rs
+++ b/compiler/rustc_lint/src/noop_method_call.rs
@@ -103,9 +103,9 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
         let Some(name) = cx.tcx.get_diagnostic_name(i.def_id()) else { return };
 
         let op = match name {
-            sym::noop_method_borrow => "borrowing",
-            sym::noop_method_clone => "cloning",
-            sym::noop_method_deref => "dereferencing",
+            sym::noop_method_borrow => "borrow",
+            sym::noop_method_clone => "clone",
+            sym::noop_method_deref => "deref",
             _ => return,
         };