Skip to content

Commit fe02aa5

Browse files
authored
Merge pull request #580 from ferrocene/tshepang/document-1.90
document Rust 1.90 changes
2 parents 21aa0c3 + 05134b1 commit fe02aa5

File tree

5 files changed

+68
-11
lines changed

5 files changed

+68
-11
lines changed

src/changelog.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,39 @@ with the change that has been applied due to it.
1818
just the language changes that had an impact to the FLS. See the `release
1919
notes`_ for a full list of changes.
2020

21+
Language changes in Rust 1.90.0
22+
-------------------------------
23+
24+
- `Split up the unknown_or_malformed_diagnostic_attributes lint <https://github.com/rust-lang/rust/pull/140717>`_
25+
26+
- No change: lints are not part of the FLS
27+
28+
- `Allow constants whose final value has references to mutable/external memory, but reject such constants as patterns <https://github.com/rust-lang/rust/pull/140942>`_
29+
30+
- This lifted restriction was not specified in the FLS
31+
- The restriction on patterns is documented in :p:`fls_wJ9f906BlBvg`
32+
- New paragraph: :p:`fls_zyuxqty09SDO`
33+
34+
- Above paragraph replaces :p:`fls_6g7c1kjrmfnr` and :p:`fls_hkbwa8xx2fwx`
35+
36+
* New paragraphs:
37+
38+
- :p:`fls_ooOYxhVh8hZo`
39+
40+
- :p:`fls_zkNFeBLy80UA`
41+
42+
- :p:`fls_VhzGfnWg7YrG`
43+
44+
- :p:`fls_ibYKKQdB2tDn`
45+
46+
- :p:`fls_dQdSxf8kOgbi`
47+
48+
- :p:`fls_qC6L0km0ZMFI`
49+
50+
- `Allow volatile access to non-Rust memory, including address 0 <https://github.com/rust-lang/rust/pull/141260>`_
51+
52+
- No change: lints are not part of the FLS
53+
2154
Language changes in Rust 1.89.0
2255
-------------------------------
2356

@@ -320,6 +353,8 @@ Language changes in Rust 1.83.0
320353

321354
* Changed paragraphs: :p:`fls_to4e7imq2c0w`, :p:`fls_6g7c1kjrmfnr`, :p:`fls_hkbwa8xx2fwx`
322355

356+
* Removed paragraph: :p:`fls_ox6sgl9n43g2`
357+
323358
* `Allow creating references to statics in \`const\` initializers. <https://github.com/rust-lang/rust/pull/129759>`_
324359

325360
* No change: This previous restriction is not specified in the FLS

src/expressions.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,6 @@ involve :t:`[type]s` that require :t:`destruction`:
209209
* :dp:`fls_b5fraqx07wuo`
210210
:t:`[If let expression]s`,
211211

212-
* :dp:`fls_6g7c1kjrmfnr`
213-
:t:`[Immutable borrow expression]s`.
214-
215212
* :dp:`fls_rpapnm3afan8`
216213
:t:`[Index expression]s`,
217214

@@ -248,9 +245,6 @@ involve :t:`[type]s` that require :t:`destruction`:
248245
* :dp:`fls_3bucpdj828bq`
249246
:t:`[Range expression]s`,
250247

251-
* :dp:`fls_hkbwa8xx2fwx`
252-
:t:`[Borrow]s`,
253-
254248
* :dp:`fls_fobs8ebt7dhc`
255249
:t:`[Struct expression]s`,
256250

@@ -271,6 +265,12 @@ involve :t:`[type]s` that require :t:`destruction`:
271265
* :dp:`fls_qvofy4wkql0s`
272266
:t:`[While loop expression]s`.
273267

268+
* :dp:`fls_zyuxqty09SDO`
269+
All forms of :t:`[borrow]s` except those of expressions that are subject to
270+
:t:`drop scope extension` to the end of the program
271+
and which are either :t:`[mutable borrow]s`
272+
or borrows of expressions that result in values with :t:`interior mutability`.
273+
274274
:dp:`fls_3i7efddbsmn0`
275275
An :t:`expression` is not considered a :t:`constant expression` when it
276276
explicitly invokes an :t:`associated trait function` or uses
@@ -312,10 +312,6 @@ 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_ox6sgl9n43g2`
316-
It is a static error to create a :t:`mutable reference` in a
317-
:t:`constant context`.
318-
319315
:dp:`fls_od0h3v40kjp6`
320316
An invocation of the :std:`core::ptr::addr_of` :t:`macro` expands to a
321317
:t:`constant expression` allowed in any :t:`constant context` and

src/patterns.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,12 @@ When a :t:`path pattern` refers to an :t:`associated constant` or a
370370
:t:`constant`, the :t:`type` of the :t:`associated constant` or :t:`constant`
371371
shall be :t:`structurally equal`.
372372

373+
:dp:`fls_wJ9f906BlBvg`
374+
When a :t:`path pattern` refers to an :t:`associated constant` or a
375+
:t:`constant`, the :t:`constant` must not contain any references to
376+
:t:`[mutable static]s`, :t:`[static]s` with :t:`interior mutability`,
377+
or :t:`[external static]s`.
378+
373379
:dp:`fls_hF19K8sWU8FF`
374380
When the type of the :t:`path pattern` is of an :t:`enum type` or
375381
:t:`struct type`, then the :t:`enum type` or :t:`struct type` shall be subject

src/values.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,26 @@ The :t:`expression` of a :t:`constant initializer` shall be a
111111
The value of a :t:`constant` is determined by evaluating its
112112
:t:`constant initializer`.
113113

114+
:dp:`fls_ooOYxhVh8hZo`
115+
After :t:`type coercion`, the value of the constant cannot contain any
116+
:t:`[mutable reference]s`, except when
117+
118+
- :dp:`fls_zkNFeBLy80UA`
119+
The :t:`mutable reference` is contained within an :t:`external static`, or
120+
121+
- :dp:`fls_VhzGfnWg7YrG`
122+
The :t:`mutable reference` is contained within a :t:`mutable static`, or
123+
124+
- :dp:`fls_qC6L0km0ZMFI`
125+
The :t:`mutable reference` is contained within a :t:`static`
126+
whose type is subject to :t:`interior mutability`, or
127+
128+
- :dp:`fls_ibYKKQdB2tDn`
129+
The :t:`mutable reference` is contained within an :t:`union`, or
130+
131+
- :dp:`fls_dQdSxf8kOgbi`
132+
The :t:`referent` is a value of a :t:`zero-sized type`.
133+
114134
.. rubric:: Dynamic Semantics
115135

116136
:dp:`fls_xezt9hl069h4`

version.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.. SPDX-License-Identifier: MIT OR Apache-2.0
22
SPDX-FileCopyrightText: The Ferrocene Developers
33
SPDX-FileCopyrightText: The Rust Project Developers
4-
.. |spec_version| replace:: 1.88.0
4+
.. |spec_version| replace:: 1.90.0

0 commit comments

Comments
 (0)