Skip to content

Commit dc5f6d2

Browse files
committed
move full explanation to after erroneous example
1 parent 2f85aa6 commit dc5f6d2

File tree

1 file changed

+5
-4
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+5
-4
lines changed

compiler/rustc_error_codes/src/error_codes/E0625.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Static and const variables can refer to other const variables. But a const
2-
variable cannot refer to a thread-local static variable.
1+
A compile-time const variable is referring to a thread-local static variable.
32

43
Erroneous code example:
54

@@ -12,8 +11,10 @@ static X: usize = 12;
1211
const Y: usize = 2 * X;
1312
```
1413

15-
In this example, `Y` cannot refer to `X`. To fix this, the value can be
16-
extracted as a const and then used:
14+
Static and const variables can refer to other const variables but a const
15+
variable cannot refer to a thread-local static variable. In this example,
16+
`Y` cannot refer to `X`. To fix this, the value can be extracted as a const
17+
and then used:
1718

1819
```
1920
#![feature(thread_local)]

0 commit comments

Comments
 (0)