diff options
| author | David Wood <david.wood@huawei.com> | 2022-06-28 14:28:02 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-06-30 08:59:22 +0100 |
| commit | 10676418fa01d4f0ae8a34c57e4a71d7cd4c7cf2 (patch) | |
| tree | 57b7c6af34703470a0c1a1edb6d62b7651dbfdf4 /compiler/rustc_lint | |
| parent | 10f2d3f566d4271ee95b9b1ae51dbf51b4aa1707 (diff) | |
| download | rust-10676418fa01d4f0ae8a34c57e4a71d7cd4c7cf2.tar.gz rust-10676418fa01d4f0ae8a34c57e4a71d7cd4c7cf2.zip | |
lint: port keyword idents diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_lint')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index df30ea93708..a3ebc547544 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -2033,10 +2033,12 @@ impl KeywordIdents { } cx.struct_span_lint(KEYWORD_IDENTS, ident.span, |lint| { - lint.build(&format!("`{}` is a keyword in the {} edition", ident, next_edition)) + lint.build(fluent::lint::builtin_keyword_idents) + .set_arg("kw", ident.clone()) + .set_arg("next", next_edition) .span_suggestion( ident.span, - "you can use a raw identifier to stay compatible", + fluent::lint::suggestion, format!("r#{}", ident), Applicability::MachineApplicable, ) |
