diff --git a/src/const_eval.md b/src/const_eval.md index e3cefa5c7..eca2530ea 100644 --- a/src/const_eval.md +++ b/src/const_eval.md @@ -38,8 +38,11 @@ to be run. * [Closure expressions] which don't capture variables from the environment. * Built-in [negation], [arithmetic], [logical], [comparison] or [lazy boolean] operators used on integer and floating point types, `bool`, and `char`. -* Shared [borrow]s, except if applied to a type with [interior mutability]. -* The [dereference operator] except for raw pointers. +* All forms of [borrow]s, including raw borrows, with one limitation: + mutable borrows and shared borrows to values with interior mutability + are only allowed to refer to *transient* places. A place is *transient* + if its lifetime is strictly contained inside the current [const context]. +* The [dereference operator]. * [Grouped] expressions. * [Cast] expressions, except * pointer to address casts and @@ -49,6 +52,7 @@ to be run. * [if], [`if let`] and [match] expressions. ## Const context +[const context]: #const-context A _const context_ is one of the following: