Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const_eval: update for const_mut_refs and const_refs_to_cell stabilization #1590

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/const_eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand Down