Skip to content

Commit c36b21a

Browse files
committed
rustc_attr: make "compact cfg(target(..)) is unstable" translatable
1 parent a11922d commit c36b21a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

compiler/rustc_attr/messages.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ attr_unknown_meta_item =
104104
attr_unknown_version_literal =
105105
unknown version literal format, assuming it refers to a future version
106106
107+
attr_unstable_cfg_target_compact =
108+
compact `cfg(target(..))` is experimental and subject to change
109+
107110
attr_unsupported_literal_cfg_string =
108111
literal in `cfg` predicate value must be a string
109112
attr_unsupported_literal_deprecated_kv_pair =

compiler/rustc_attr/src/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use rustc_span::hygiene::Transparency;
2020
use rustc_span::symbol::{sym, Symbol};
2121
use rustc_span::Span;
2222

23+
use crate::fluent_generated;
2324
use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause};
2425

2526
/// The version placeholder that recently stabilized features contain inside the
@@ -592,7 +593,6 @@ pub fn parse_version(s: Symbol) -> Option<RustcVersion> {
592593

593594
/// Evaluate a cfg-like condition (with `any` and `all`), using `eval` to
594595
/// evaluate individual items.
595-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
596596
pub fn eval_condition(
597597
cfg: &ast::MetaItem,
598598
sess: &Session,
@@ -679,7 +679,7 @@ pub fn eval_condition(
679679
sess,
680680
sym::cfg_target_compact,
681681
cfg.span,
682-
"compact `cfg(target(..))` is experimental and subject to change",
682+
fluent_generated::attr_unstable_cfg_target_compact,
683683
)
684684
.emit();
685685
}

0 commit comments

Comments
 (0)