Skip to content

Commit 475378f

Browse files
committed
add match to diagnostic messages
1 parent e928067 commit 475378f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

compiler/rustc_lint/messages.ftl

+6-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ lint_renamed_or_removed_lint = {$msg}
5151
.suggestion = use the new name
5252
5353
lint_suspicious_double_ref_op =
54-
using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op} the inner type
54+
using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op ->
55+
*[should_not_happen] [{$op}]
56+
[deref] dereferencing
57+
[borrow] borrowing
58+
[clone] cloning
59+
} the inner type
5560
5661
lint_unknown_lint =
5762
unknown lint: `{$name}`

compiler/rustc_lint/src/noop_method_call.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
103103
let Some(name) = cx.tcx.get_diagnostic_name(i.def_id()) else { return };
104104

105105
let op = match name {
106-
sym::noop_method_borrow => "borrowing",
107-
sym::noop_method_clone => "cloning",
108-
sym::noop_method_deref => "dereferencing",
106+
sym::noop_method_borrow => "borrow",
107+
sym::noop_method_clone => "clone",
108+
sym::noop_method_deref => "deref",
109109
_ => return,
110110
};
111111

0 commit comments

Comments
 (0)