Skip to content

Commit 9d83c64

Browse files
committed
const-eval.const-expr.borrows: mention indirect places
1 parent c590f78 commit 9d83c64

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/const_eval.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ 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 or to *static* places. A place is *transient*
87-
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].
86+
are only allowed to refer to *transient* places, to *indirect* places, or to *static* places.
87+
A place is *transient* if it is based on a local variable whose lifetime is strictly contained inside the current [const context].
88+
A place is *indirect* if it is based on a [dereference expression][dereference operator].
89+
A place is *static* if it is based on a `static` item or a [promoted expression].
8990

9091
r[const-eval.const-expr.deref]
9192
* The [dereference operator] except for raw pointers.

0 commit comments

Comments
 (0)