rustc_metadata: make "link {arg,cfg} is unstable" translatable
This commit is contained in:
@@ -131,12 +131,18 @@ metadata_lib_framework_apple =
|
|||||||
metadata_lib_required =
|
metadata_lib_required =
|
||||||
crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form
|
crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form
|
||||||
|
|
||||||
|
metadata_link_arg_unstable =
|
||||||
|
link kind `link-arg` is unstable
|
||||||
|
|
||||||
metadata_link_cfg_form =
|
metadata_link_cfg_form =
|
||||||
link cfg must be of the form `cfg(/* predicate */)`
|
link cfg must be of the form `cfg(/* predicate */)`
|
||||||
|
|
||||||
metadata_link_cfg_single_predicate =
|
metadata_link_cfg_single_predicate =
|
||||||
link cfg must have a single predicate argument
|
link cfg must have a single predicate argument
|
||||||
|
|
||||||
|
metadata_link_cfg_unstable =
|
||||||
|
link cfg is unstable
|
||||||
|
|
||||||
metadata_link_framework_apple =
|
metadata_link_framework_apple =
|
||||||
link kind `framework` is only supported on Apple targets
|
link kind `framework` is only supported on Apple targets
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use rustc_span::def_id::{DefId, LOCAL_CRATE};
|
|||||||
use rustc_span::symbol::{sym, Symbol};
|
use rustc_span::symbol::{sym, Symbol};
|
||||||
use rustc_target::spec::abi::Abi;
|
use rustc_target::spec::abi::Abi;
|
||||||
|
|
||||||
use crate::errors;
|
use crate::{errors, fluent_generated};
|
||||||
|
|
||||||
pub fn find_native_static_library(name: &str, verbatim: bool, sess: &Session) -> PathBuf {
|
pub fn find_native_static_library(name: &str, verbatim: bool, sess: &Session) -> PathBuf {
|
||||||
let formats = if verbatim {
|
let formats = if verbatim {
|
||||||
@@ -87,7 +87,6 @@ struct Collector<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Collector<'tcx> {
|
impl<'tcx> Collector<'tcx> {
|
||||||
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
|
||||||
fn process_module(&mut self, module: &ForeignModule) {
|
fn process_module(&mut self, module: &ForeignModule) {
|
||||||
let ForeignModule { def_id, abi, ref foreign_items } = *module;
|
let ForeignModule { def_id, abi, ref foreign_items } = *module;
|
||||||
let def_id = def_id.expect_local();
|
let def_id = def_id.expect_local();
|
||||||
@@ -161,7 +160,7 @@ impl<'tcx> Collector<'tcx> {
|
|||||||
sess,
|
sess,
|
||||||
sym::link_arg_attribute,
|
sym::link_arg_attribute,
|
||||||
span,
|
span,
|
||||||
"link kind `link-arg` is unstable",
|
fluent_generated::metadata_link_arg_unstable,
|
||||||
)
|
)
|
||||||
.emit();
|
.emit();
|
||||||
}
|
}
|
||||||
@@ -201,7 +200,12 @@ impl<'tcx> Collector<'tcx> {
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
if !features.link_cfg {
|
if !features.link_cfg {
|
||||||
feature_err(sess, sym::link_cfg, item.span(), "link cfg is unstable")
|
feature_err(
|
||||||
|
sess,
|
||||||
|
sym::link_cfg,
|
||||||
|
item.span(),
|
||||||
|
fluent_generated::metadata_link_cfg_unstable,
|
||||||
|
)
|
||||||
.emit();
|
.emit();
|
||||||
}
|
}
|
||||||
cfg = Some(link_cfg.clone());
|
cfg = Some(link_cfg.clone());
|
||||||
@@ -266,6 +270,8 @@ impl<'tcx> Collector<'tcx> {
|
|||||||
|
|
||||||
macro report_unstable_modifier($feature: ident) {
|
macro report_unstable_modifier($feature: ident) {
|
||||||
if !features.$feature {
|
if !features.$feature {
|
||||||
|
// FIXME: make this translatable
|
||||||
|
#[expect(rustc::untranslatable_diagnostic)]
|
||||||
feature_err(
|
feature_err(
|
||||||
sess,
|
sess,
|
||||||
sym::$feature,
|
sym::$feature,
|
||||||
|
|||||||
Reference in New Issue
Block a user