Skip to content

Commit ad06623

Browse files
rewording and make different cases for static and const eval context
1 parent 2aa4e88 commit ad06623

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/const_eval.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ r[const-eval.const-expr.path-item]
4343

4444
r[const-eval.const-expr.path-static]
4545
* Paths to [statics] with these restrictions and observations.
46-
* In particular, reads and writes to any `static mut` or [`extern` statics] is not allowed.
46+
* If the evaluation is carried out in an initializer of a `const` item, or inside a `const` block, reads and writes to any `static mut` or [`extern` statics] are not allowed.
47+
* If the evaluation is carried out in an initializer of a `static` item, reads into a `static`, or inside `unsafe` blocks reads into `static mut` are allowed. Reads and writes to `extern` statics are still not allowed.
4748

4849
r[const-eval.const-expr.tuple]
4950
* [Tuple expressions].

src/items/constant-items.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
4848
};
4949
```
5050

51+
r[items.const.final-value-immutable]
5152
The final value of a `const` item cannot contain references to anything mutable.
5253

5354
r[items.const.expr-omission]

0 commit comments

Comments
 (0)