diff options
| author | David Wood <david.wood@huawei.com> | 2022-06-27 15:09:24 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-06-30 08:59:21 +0100 |
| commit | 1c3a3e07114d651b41cb050d8e6cbff8b8528295 (patch) | |
| tree | c700e0becbc6aac9f49af6cd476f4da799cd9e58 | |
| parent | 0996a7ab5cecaf8c962e4df2450edd8371d1d93f (diff) | |
| download | rust-1c3a3e07114d651b41cb050d8e6cbff8b8528295.tar.gz rust-1c3a3e07114d651b41cb050d8e6cbff8b8528295.zip | |
lint: port impl `LintPass` by hand diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
| -rw-r--r-- | compiler/rustc_error_messages/locales/en-US/lint.ftl | 3 | ||||
| -rw-r--r-- | 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(); }, ) |
