make the const-unstable-in-stable error more clear

This commit is contained in:
Ralf Jung 2024-08-31 15:06:21 +02:00
parent fa72f0763d
commit e3b1966137
2 changed files with 4 additions and 4 deletions

View File

@ -415,8 +415,8 @@ const_eval_unstable_const_fn = `{$def_path}` is not yet stable as a const fn
const_eval_unstable_in_stable = const_eval_unstable_in_stable =
const-stable function cannot use `#[feature({$gate})]` const-stable function cannot use `#[feature({$gate})]`
.unstable_sugg = if it is not part of the public API, make this function unstably const .unstable_sugg = if the function is not (yet) meant to be stable, make this function unstably const
.bypass_sugg = otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks (but requires team approval) .bypass_sugg = otherwise, as a last resort `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks (but requires team approval)
const_eval_unterminated_c_string = const_eval_unterminated_c_string =
reading a null-terminated string starting at {$pointer} with no null found before end of allocation reading a null-terminated string starting at {$pointer} with no null found before end of allocation

View File

@ -20,12 +20,12 @@ error: const-stable function cannot use `#[feature(const_refs_to_cell)]`
LL | x.get(); LL | x.get();
| ^ | ^
| |
help: if it is not part of the public API, make this function unstably const help: if the function is not (yet) meant to be stable, make this function unstably const
| |
LL + #[rustc_const_unstable(feature = "...", issue = "...")] LL + #[rustc_const_unstable(feature = "...", issue = "...")]
LL | const fn bar3() -> u32 { LL | const fn bar3() -> u32 {
| |
help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks (but requires team approval) help: otherwise, as a last resort `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks (but requires team approval)
| |
LL + #[rustc_allow_const_fn_unstable(const_refs_to_cell)] LL + #[rustc_allow_const_fn_unstable(const_refs_to_cell)]
LL | const fn bar3() -> u32 { LL | const fn bar3() -> u32 {