rustc_const_eval: make LazyLock suggestion translatable
This commit is contained in:
parent
3a18c6b55f
commit
a11922d568
2 changed files with 4 additions and 1 deletions
|
@ -203,6 +203,9 @@ const_eval_invalid_vtable_pointer =
|
||||||
const_eval_invalid_vtable_trait =
|
const_eval_invalid_vtable_trait =
|
||||||
using vtable for trait `{$vtable_trait}` but trait `{$expected_trait}` was expected
|
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 =
|
const_eval_live_drop =
|
||||||
destructor of `{$dropped_ty}` cannot be evaluated at compile-time
|
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
|
.label = the destructor for this type cannot be evaluated in {const_eval_const_context}s
|
||||||
|
|
|
@ -310,7 +310,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let ConstContext::Static(_) = ccx.const_kind() {
|
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
|
err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue