rustc_attr: make "compact cfg(target(..)) is unstable" translatable

This commit is contained in:
Pavel Grigorenko 2024-08-07 23:23:35 +03:00
parent a11922d568
commit c36b21a4c8
2 changed files with 5 additions and 2 deletions

View File

@ -104,6 +104,9 @@ attr_unknown_meta_item =
attr_unknown_version_literal = attr_unknown_version_literal =
unknown version literal format, assuming it refers to a future version unknown version literal format, assuming it refers to a future version
attr_unstable_cfg_target_compact =
compact `cfg(target(..))` is experimental and subject to change
attr_unsupported_literal_cfg_string = attr_unsupported_literal_cfg_string =
literal in `cfg` predicate value must be a string literal in `cfg` predicate value must be a string
attr_unsupported_literal_deprecated_kv_pair = attr_unsupported_literal_deprecated_kv_pair =

View File

@ -20,6 +20,7 @@ use rustc_span::hygiene::Transparency;
use rustc_span::symbol::{sym, Symbol}; use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span; use rustc_span::Span;
use crate::fluent_generated;
use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause}; use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause};
/// The version placeholder that recently stabilized features contain inside the /// The version placeholder that recently stabilized features contain inside the
@ -592,7 +593,6 @@ pub fn parse_version(s: Symbol) -> Option<RustcVersion> {
/// Evaluate a cfg-like condition (with `any` and `all`), using `eval` to /// Evaluate a cfg-like condition (with `any` and `all`), using `eval` to
/// evaluate individual items. /// evaluate individual items.
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
pub fn eval_condition( pub fn eval_condition(
cfg: &ast::MetaItem, cfg: &ast::MetaItem,
sess: &Session, sess: &Session,
@ -679,7 +679,7 @@ pub fn eval_condition(
sess, sess,
sym::cfg_target_compact, sym::cfg_target_compact,
cfg.span, cfg.span,
"compact `cfg(target(..))` is experimental and subject to change", fluent_generated::attr_unstable_cfg_target_compact,
) )
.emit(); .emit();
} }