1
Fork 0

Migrate StaticAccess diagnostic

This commit is contained in:
Michael Goulet 2022-06-28 22:32:32 -07:00
parent ff9fd36aa4
commit c48f482813
3 changed files with 32 additions and 20 deletions

View file

@ -4,4 +4,14 @@ const-eval-unstable-in-stable =
.bypass-sugg = otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
const-eval-thread-local-access =
thread-local statics cannot be accessed at compile-time
thread-local statics cannot be accessed at compile-time
const-eval-static-access =
{ $kind ->
[constant function] constant functions
[static] statics
*[constant] constants
} cannot refer to statics
.help = consider extracting the value of the `static` to a `const`, and referring to that
.teach-note = `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
.teach-help = To fix this, the value can be extracted to a `const` and then used.