rustc_expand: make a message translatable

This commit is contained in:
Pavel Grigorenko 2024-08-09 00:53:15 +03:00
parent fbc2459015
commit 137307477f
2 changed files with 5 additions and 2 deletions

View File

@ -129,6 +129,9 @@ expand_module_multiple_candidates =
expand_must_repeat_once =
this must repeat at least once
expand_non_inline_modules_in_proc_macro_input_are_unstable =
non-inline modules in proc macro input are unstable
expand_not_a_meta_item =
not a meta item

View File

@ -39,6 +39,7 @@
RecursionLimitReached, RemoveExprNotSupported, RemoveNodeNotSupported, UnsupportedKeyValue,
WrongFragmentKind,
};
use crate::fluent_generated;
use crate::mbe::diagnostics::annotate_err_with_kind;
use crate::module::{mod_dir_path, parse_external_mod, DirOwnership, ParsedExternalMod};
use crate::placeholders::{placeholder, PlaceholderExpander};
@ -882,7 +883,6 @@ struct GateProcMacroInput<'a> {
}
impl<'ast, 'a> Visitor<'ast> for GateProcMacroInput<'a> {
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn visit_item(&mut self, item: &'ast ast::Item) {
match &item.kind {
ItemKind::Mod(_, mod_kind)
@ -892,7 +892,7 @@ fn visit_item(&mut self, item: &'ast ast::Item) {
self.sess,
sym::proc_macro_hygiene,
item.span,
"non-inline modules in proc macro input are unstable",
fluent_generated::expand_non_inline_modules_in_proc_macro_input_are_unstable,
)
.emit();
}