Skip to content

Commit 00c1bfd

Browse files
committed
add restrictions on constant expressions
1 parent 47ce8fd commit 00c1bfd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Language changes in Rust 1.90.0
2929

3030
- This lifted restriction was not specified in the FLS
3131
- The restriction on patterns is documented in :p:`fls_wJ9f906BlBvg`
32+
- New paragraph: :p:`fls_zyuxqty09SDO`
3233

3334
- `Allow volatile access to non-Rust memory, including address 0 <https://github.com/rust-lang/rust/pull/141260>`_
3435

src/expressions.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ A :t:`constant context` is a :t:`construct` that requires a
312312
* :dp:`fls_ucFupTeCyylb`
313313
The :t:`block expression` of a :t:`const block expression`.
314314

315+
* :dp:`fls_zyuxqty09SDO`
316+
All forms of :t:`[borrow]s` except those of expressions that would be subject to
317+
:t:`drop scope extension`,
318+
and which are either :t:`[mutable borrow]s`
319+
or borrows of expressions that result in values with :t:`interior mutability`.
320+
315321
:dp:`fls_od0h3v40kjp6`
316322
An invocation of the :std:`core::ptr::addr_of` :t:`macro` expands to a
317323
:t:`constant expression` allowed in any :t:`constant context` and

0 commit comments

Comments
 (0)