rustc_const_eval: make LazyLock suggestion translatable

This commit is contained in:
Pavel Grigorenko 2024-08-07 18:42:55 +03:00
parent 3a18c6b55f
commit a11922d568
2 changed files with 4 additions and 1 deletions

View file

@ -203,6 +203,9 @@ const_eval_invalid_vtable_pointer =
const_eval_invalid_vtable_trait =
using vtable for trait `{$vtable_trait}` but trait `{$expected_trait}` was expected
const_eval_lazy_lock =
consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
const_eval_live_drop =
destructor of `{$dropped_ty}` cannot be evaluated at compile-time
.label = the destructor for this type cannot be evaluated in {const_eval_const_context}s

View file

@ -310,7 +310,7 @@ macro_rules! error {
}
if let ConstContext::Static(_) = ccx.const_kind() {
err.note("consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`");
err.note(fluent_generated::const_eval_lazy_lock);
}
err