about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-06-27 11:38:45 +0100
committerDavid Wood <david.wood@huawei.com>2022-06-30 08:58:41 +0100
commit7d2eba6311dfaf615866442fb9e3730a8d888748 (patch)
treec26fa6464b46c74a06543b383e5ce2684f57baf9 /compiler/rustc_lint/src
parenta9eb9c52f3e8d8b6402e6acc69b9bcfc4f371d58 (diff)
downloadrust-7d2eba6311dfaf615866442fb9e3730a8d888748.tar.gz
rust-7d2eba6311dfaf615866442fb9e3730a8d888748.zip
middle: translation in `LintDiagnosticBuilder`
Accept `DiagnosticMessage` in `LintDiagnosticBuilder::build` so that
lints can be built with translatable diagnostic messages.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/levels.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs
index 4773feded12..bf4a726b061 100644
--- a/compiler/rustc_lint/src/levels.rs
+++ b/compiler/rustc_lint/src/levels.rs
@@ -521,7 +521,7 @@ impl<'s> LintLevelsBuilder<'s> {
                             src,
                             Some(sp.into()),
                             |lint| {
-                                let mut err = lint.build(&msg);
+                                let mut err = lint.build(msg);
                                 if let Some(new_name) = &renamed {
                                     err.span_suggestion(
                                         sp,
@@ -548,7 +548,7 @@ impl<'s> LintLevelsBuilder<'s> {
                             } else {
                                 name.to_string()
                             };
-                            let mut db = lint.build(&format!("unknown lint: `{}`", name));
+                            let mut db = lint.build(format!("unknown lint: `{}`", name));
                             if let Some(suggestion) = suggestion {
                                 db.span_suggestion(
                                     sp,