Skip to content

Commit 007cc2c

Browse files
committed
rustc_metadata: make "link {arg,cfg} is unstable" translatable
1 parent d548636 commit 007cc2c

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Diff for: compiler/rustc_metadata/messages.ftl

+6
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,18 @@ metadata_lib_framework_apple =
131131
metadata_lib_required =
132132
crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form
133133
134+
metadata_link_arg_unstable =
135+
link kind `link-arg` is unstable
136+
134137
metadata_link_cfg_form =
135138
link cfg must be of the form `cfg(/* predicate */)`
136139
137140
metadata_link_cfg_single_predicate =
138141
link cfg must have a single predicate argument
139142
143+
metadata_link_cfg_unstable =
144+
link cfg is unstable
145+
140146
metadata_link_framework_apple =
141147
link kind `framework` is only supported on Apple targets
142148

Diff for: compiler/rustc_metadata/src/native_libs.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc_span::def_id::{DefId, LOCAL_CRATE};
1717
use rustc_span::symbol::{sym, Symbol};
1818
use rustc_target::spec::abi::Abi;
1919

20-
use crate::errors;
20+
use crate::{errors, fluent_generated};
2121

2222
pub fn find_native_static_library(name: &str, verbatim: bool, sess: &Session) -> PathBuf {
2323
let formats = if verbatim {
@@ -87,7 +87,6 @@ struct Collector<'tcx> {
8787
}
8888

8989
impl<'tcx> Collector<'tcx> {
90-
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
9190
fn process_module(&mut self, module: &ForeignModule) {
9291
let ForeignModule { def_id, abi, ref foreign_items } = *module;
9392
let def_id = def_id.expect_local();
@@ -161,7 +160,7 @@ impl<'tcx> Collector<'tcx> {
161160
sess,
162161
sym::link_arg_attribute,
163162
span,
164-
"link kind `link-arg` is unstable",
163+
fluent_generated::metadata_link_arg_unstable,
165164
)
166165
.emit();
167166
}
@@ -201,8 +200,13 @@ impl<'tcx> Collector<'tcx> {
201200
continue;
202201
};
203202
if !features.link_cfg {
204-
feature_err(sess, sym::link_cfg, item.span(), "link cfg is unstable")
205-
.emit();
203+
feature_err(
204+
sess,
205+
sym::link_cfg,
206+
item.span(),
207+
fluent_generated::metadata_link_cfg_unstable,
208+
)
209+
.emit();
206210
}
207211
cfg = Some(link_cfg.clone());
208212
}
@@ -266,6 +270,8 @@ impl<'tcx> Collector<'tcx> {
266270

267271
macro report_unstable_modifier($feature: ident) {
268272
if !features.$feature {
273+
// FIXME: make this translatable
274+
#[expect(rustc::untranslatable_diagnostic)]
269275
feature_err(
270276
sess,
271277
sym::$feature,

0 commit comments

Comments
 (0)