diff options
| author | Brandon H. Gomes <bh.gomes@rutgers.edu> | 2021-08-04 15:49:00 -0400 |
|---|---|---|
| committer | Brandon H. Gomes <bh.gomes@rutgers.edu> | 2021-08-04 15:49:00 -0400 |
| commit | dc5f6d2e48d21dccbe58d755dd73cf9c6fb886b5 (patch) | |
| tree | 5d6af7da8730d75745c056e8737b6923473f5a8d /compiler/rustc_error_codes/src | |
| parent | 2f85aa6590380e7f39e4c9a79bf15110938c4b4b (diff) | |
| download | rust-dc5f6d2e48d21dccbe58d755dd73cf9c6fb886b5.tar.gz rust-dc5f6d2e48d21dccbe58d755dd73cf9c6fb886b5.zip | |
move full explanation to after erroneous example
Diffstat (limited to 'compiler/rustc_error_codes/src')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0625.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0625.md b/compiler/rustc_error_codes/src/error_codes/E0625.md index 93e2928dd7a..7db857723cc 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0625.md +++ b/compiler/rustc_error_codes/src/error_codes/E0625.md @@ -1,5 +1,4 @@ -Static and const variables can refer to other const variables. But a const -variable cannot refer to a thread-local static variable. +A compile-time const variable is referring to a thread-local static variable. Erroneous code example: @@ -12,8 +11,10 @@ static X: usize = 12; const Y: usize = 2 * X; ``` -In this example, `Y` cannot refer to `X`. To fix this, the value can be -extracted as a const and then used: +Static and const variables can refer to other const variables but a const +variable cannot refer to a thread-local static variable. In this example, +`Y` cannot refer to `X`. To fix this, the value can be extracted as a const +and then used: ``` #![feature(thread_local)] |
