Skip to content

Commit 8da7b2a

Browse files
authored
Merge pull request #1590 from RalfJung/const-mut-refs
const_eval: update for const_mut_refs and const_refs_to_cell stabilization
2 parents 23997f4 + ace105a commit 8da7b2a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/const_eval.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ to be run.
3838
* [Closure expressions] which don't capture variables from the environment.
3939
* Built-in [negation], [arithmetic], [logical], [comparison] or [lazy boolean]
4040
operators used on integer and floating point types, `bool`, and `char`.
41-
* Shared [borrow]s, except if applied to a type with [interior mutability].
42-
* The [dereference operator] except for raw pointers.
41+
* All forms of [borrow]s, including raw borrows, with one limitation:
42+
mutable borrows and shared borrows to values with interior mutability
43+
are only allowed to refer to *transient* places. A place is *transient*
44+
if its lifetime is strictly contained inside the current [const context].
45+
* The [dereference operator].
4346
* [Grouped] expressions.
4447
* [Cast] expressions, except
4548
* pointer to address casts and
@@ -49,6 +52,7 @@ to be run.
4952
* [if], [`if let`] and [match] expressions.
5053

5154
## Const context
55+
[const context]: #const-context
5256

5357
A _const context_ is one of the following:
5458

0 commit comments

Comments
 (0)