Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 committed Nov 22, 2024
1 parent ad06623 commit c14d6ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/const_eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ r[const-eval.const-expr.path-item]

r[const-eval.const-expr.path-static]
* Paths to [statics] with these restrictions and observations.
* 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.
* 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.
* Reads and writes to `extern` statics are not allowed in any constant evaluation context.
* If the evaluation is carried out in an initializer of a `static` item, then *writes* into mutable `static` are not allowed, such as `static mut`s and `static`s containing an interior-mutable type.
* If the evaluation is *not* carried out in an initializer of a `static` item, then reads and writes to any mutable `static`, such as `static mut`s and `static`s containing an interior-mutable type.

r[const-eval.const-expr.tuple]
* [Tuple expressions].
Expand Down

0 comments on commit c14d6ff

Please sign in to comment.