Skip to content

Commit 1bacab1

Browse files
committed
const_eval: update for const_mut_refs and const_refs_to_cell stabilization
1 parent f0f6155 commit 1bacab1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/const_eval.md

+5-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 it will be deallocated before the end of evaluating the current constant item.
45+
* The [dereference operator].
4346
* [Grouped] expressions.
4447
* [Cast] expressions, except
4548
* pointer to address casts and

0 commit comments

Comments
 (0)