Skip to content

Commit c590f78

Browse files
authored
Merge pull request #1858 from RalfJung/const-eval-refs
const_eval: we allow references to statics and promoteds
2 parents cffcda7 + 26eafc5 commit c590f78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/const_eval.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ r[const-eval.const-expr.builtin-arith-logic]
8383
r[const-eval.const-expr.borrows]
8484
* All forms of [borrow]s, including raw borrows, with one limitation:
8585
mutable borrows and shared borrows to values with interior mutability
86-
are only allowed to refer to *transient* places. A place is *transient*
86+
are only allowed to refer to *transient* places or to *static* places. A place is *transient*
8787
if its lifetime is strictly contained inside the current [const context].
88+
A place is *static* if it is a `static` item or a [promoted expression].
8889

8990
r[const-eval.const-expr.deref]
9091
* The [dereference operator] except for raw pointers.
@@ -195,6 +196,7 @@ of whether you are building on a `64` bit or a `32` bit system.
195196
[overflow]: expressions/operator-expr.md#overflow
196197
[paths]: expressions/path-expr.md
197198
[patterns]: patterns.md
199+
[promoted expression]: destructors.md#constant-promotion
198200
[range expressions]: expressions/range-expr.md
199201
[slice]: types/slice.md
200202
[statics]: items/static-items.md

0 commit comments

Comments
 (0)