From 1c3a3e07114d651b41cb050d8e6cbff8b8528295 Mon Sep 17 00:00:00 2001 From: David Wood Date: Mon, 27 Jun 2022 15:09:24 +0100 Subject: [PATCH] lint: port impl `LintPass` by hand diagnostics Signed-off-by: David Wood --- compiler/rustc_error_messages/locales/en-US/lint.ftl | 3 +++ compiler/rustc_lint/src/internal.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_error_messages/locales/en-US/lint.ftl b/compiler/rustc_error_messages/locales/en-US/lint.ftl index 43c21b380a5..ec0b9697a74 100644 --- a/compiler/rustc_error_messages/locales/en-US/lint.ftl +++ b/compiler/rustc_error_messages/locales/en-US/lint.ftl @@ -43,3 +43,6 @@ lint-tykind = usage of `ty::TyKind` lint-ty-qualified = usage of qualified `ty::{$ty}` .suggestion = try importing it and using it unqualified + +lint-lintpass-by-hand = implementing `LintPass` by hand + .help = try using `declare_lint_pass!` or `impl_lint_pass!` instead diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index 3707abd2838..92273360d2e 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -325,8 +325,8 @@ impl EarlyLintPass for LintPassImpl { LINT_PASS_IMPL_WITHOUT_MACRO, lint_pass.path.span, |lint| { - lint.build("implementing `LintPass` by hand") - .help("try using `declare_lint_pass!` or `impl_lint_pass!` instead") + lint.build(fluent::lint::lintpass_by_hand) + .help(fluent::lint::help) .emit(); }, )