rustc_const_eval: make message about "const stable" translatable
This commit is contained in:
parent
43f3a218ea
commit
3a18c6b55f
2 changed files with 4 additions and 2 deletions
|
@ -41,6 +41,8 @@ const_eval_const_context = {$kind ->
|
||||||
*[other] {""}
|
*[other] {""}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const_eval_const_stable = const-stable functions can only call other const-stable functions
|
||||||
|
|
||||||
const_eval_copy_nonoverlapping_overlapping =
|
const_eval_copy_nonoverlapping_overlapping =
|
||||||
`copy_nonoverlapping` called on overlapping ranges
|
`copy_nonoverlapping` called on overlapping ranges
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ use rustc_trait_selection::traits::SelectionContext;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
use super::ConstCx;
|
use super::ConstCx;
|
||||||
use crate::errors;
|
use crate::{errors, fluent_generated};
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
pub enum Status {
|
pub enum Status {
|
||||||
|
@ -334,7 +334,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallUnstable {
|
||||||
// FIXME: make this translatable
|
// FIXME: make this translatable
|
||||||
#[allow(rustc::untranslatable_diagnostic)]
|
#[allow(rustc::untranslatable_diagnostic)]
|
||||||
if ccx.is_const_stable_const_fn() {
|
if ccx.is_const_stable_const_fn() {
|
||||||
err.help("const-stable functions can only call other const-stable functions");
|
err.help(fluent_generated::const_eval_const_stable);
|
||||||
} else if ccx.tcx.sess.is_nightly_build() {
|
} else if ccx.tcx.sess.is_nightly_build() {
|
||||||
if let Some(feature) = feature {
|
if let Some(feature) = feature {
|
||||||
err.help(format!("add `#![feature({feature})]` to the crate attributes to enable"));
|
err.help(format!("add `#![feature({feature})]` to the crate attributes to enable"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue