From 6cecf63b9429e36846b866407f58c015229251c8 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Fri, 10 Oct 2025 16:25:24 +0200 Subject: [PATCH 1/9] document Rust 1.90 changes --- src/changelog.rst | 15 +++++++++++++++ src/patterns.rst | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/src/changelog.rst b/src/changelog.rst index 1bd0db60..dcd8b541 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -18,6 +18,21 @@ with the change that has been applied due to it. just the language changes that had an impact to the FLS. See the `release notes`_ for a full list of changes. +Language changes in Rust 1.90.0 +------------------------------- + +- `Split up the unknown_or_malformed_diagnostic_attributes lint `_ + + - No change: lints are not part of the FLS + +- `Allow constants whose final value has references to mutable/external memory, but reject such constants as patterns `_ + + - New paragraph: :p:`fls_wJ9f906BlBvg` + +- `Allow volatile access to non-Rust memory, including address 0 `_ + + - No change: lints are not part of the FLS + Language changes in Rust 1.89.0 ------------------------------- diff --git a/src/patterns.rst b/src/patterns.rst index d7b8f0f8..74674c96 100644 --- a/src/patterns.rst +++ b/src/patterns.rst @@ -370,6 +370,12 @@ When a :t:`path pattern` refers to an :t:`associated constant` or a :t:`constant`, the :t:`type` of the :t:`associated constant` or :t:`constant` shall be :t:`structurally equal`. +:dp:`fls_wJ9f906BlBvg` +When a :t:`path pattern` refers to an :t:`associated constant` or a +:t:`constant`, the :t:`constant` must not contain any references to +:t:`[mutable static]s`, :t:`[static]s` with :t:`interior mutability`, +or :t:`[external static]s`. + :dp:`fls_hF19K8sWU8FF` When the type of the :t:`path pattern` is of an :t:`enum type` or :t:`struct type`, then the :t:`enum type` or :t:`struct type` shall be subject From f669cc94e35543bd13ebc67c88e9ea1c518d6946 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Fri, 10 Oct 2025 21:57:27 +0200 Subject: [PATCH 2/9] bump version --- version.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.rst b/version.rst index c2f931c7..928a28e3 100644 --- a/version.rst +++ b/version.rst @@ -1,4 +1,4 @@ .. SPDX-License-Identifier: MIT OR Apache-2.0 SPDX-FileCopyrightText: The Ferrocene Developers SPDX-FileCopyrightText: The Rust Project Developers -.. |spec_version| replace:: 1.88.0 +.. |spec_version| replace:: 1.90.0 From b874b5dd1de4527769f180a33ae1ac79d25ae0c1 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Tue, 14 Oct 2025 00:06:40 +0200 Subject: [PATCH 3/9] the restriction was not documented --- src/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/changelog.rst b/src/changelog.rst index dcd8b541..589fcff7 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -27,7 +27,8 @@ Language changes in Rust 1.90.0 - `Allow constants whose final value has references to mutable/external memory, but reject such constants as patterns `_ - - New paragraph: :p:`fls_wJ9f906BlBvg` + - This lifted restriction was not specified in the FLS + - The restriction on patterns is documented in :p:`fls_wJ9f906BlBvg` - `Allow volatile access to non-Rust memory, including address 0 `_ From a9fdd2de07acdee4bdbe75e65ebd2ea5d790c463 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Thu, 16 Oct 2025 15:24:26 +0200 Subject: [PATCH 4/9] remove an obsolete restriction --- src/changelog.rst | 1 + src/expressions.rst | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/changelog.rst b/src/changelog.rst index 589fcff7..03386d66 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -332,6 +332,7 @@ Language changes in Rust 1.83.0 * `Stabilize \`&mut\`, \`*mut\`, \`&Cell\`, and \`*const Cell\` in const. `_ * Changed paragraphs: :p:`fls_to4e7imq2c0w`, :p:`fls_6g7c1kjrmfnr`, :p:`fls_hkbwa8xx2fwx` + * Removed paragraph: :p:`fls_ox6sgl9n43g2` * `Allow creating references to statics in \`const\` initializers. `_ diff --git a/src/expressions.rst b/src/expressions.rst index d5a1884d..381d6f4f 100644 --- a/src/expressions.rst +++ b/src/expressions.rst @@ -312,10 +312,6 @@ A :t:`constant context` is a :t:`construct` that requires a * :dp:`fls_ucFupTeCyylb` The :t:`block expression` of a :t:`const block expression`. -:dp:`fls_ox6sgl9n43g2` -It is a static error to create a :t:`mutable reference` in a -:t:`constant context`. - :dp:`fls_od0h3v40kjp6` An invocation of the :std:`core::ptr::addr_of` :t:`macro` expands to a :t:`constant expression` allowed in any :t:`constant context` and From af19a30fb7b74d3561f0031449db4f6444be1466 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 18 Oct 2025 12:05:15 +0200 Subject: [PATCH 5/9] restore an adjusted restriction --- src/changelog.rst | 11 +++++++++-- src/values.rst | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/changelog.rst b/src/changelog.rst index 03386d66..d0373fbe 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -331,8 +331,15 @@ Language changes in Rust 1.83.0 * `Stabilize \`&mut\`, \`*mut\`, \`&Cell\`, and \`*const Cell\` in const. `_ - * Changed paragraphs: :p:`fls_to4e7imq2c0w`, :p:`fls_6g7c1kjrmfnr`, :p:`fls_hkbwa8xx2fwx` - * Removed paragraph: :p:`fls_ox6sgl9n43g2` + * Changed paragraphs: + + - :p:`fls_to4e7imq2c0w` + + - :p:`fls_6g7c1kjrmfnr` + + - :p:`fls_hkbwa8xx2fwx` + + - :p:`fls_ox6sgl9n43g2` * `Allow creating references to statics in \`const\` initializers. `_ diff --git a/src/values.rst b/src/values.rst index 68c27eb5..37190235 100644 --- a/src/values.rst +++ b/src/values.rst @@ -95,6 +95,9 @@ The :t:`type specification` of a :t:`constant` shall have ``'static`` The :t:`type` of a :t:`constant` shall implement the :std:`core::marker::Sized` :t:`trait`. +:dp:`fls_ox6sgl9n43g2` +The type of a :t:`constant` cannot be a :t:`mutable reference type`. + :dp:`fls_ndmfqxjpvsqy` A :t:`constant initializer` is a :t:`construct` that provides the :t:`value` of its related :t:`constant`. From 47ce8fd6bc5fc0130877513efcf7cebf1f33501f Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 18 Oct 2025 14:03:54 +0200 Subject: [PATCH 6/9] that equivalent paragraph was actually moved to a new place --- src/changelog.rst | 10 +++------- src/values.rst | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/changelog.rst b/src/changelog.rst index d0373fbe..6e573083 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -331,15 +331,11 @@ Language changes in Rust 1.83.0 * `Stabilize \`&mut\`, \`*mut\`, \`&Cell\`, and \`*const Cell\` in const. `_ - * Changed paragraphs: + * Changed paragraphs: :p:`fls_to4e7imq2c0w`, :p:`fls_6g7c1kjrmfnr`, :p:`fls_hkbwa8xx2fwx` - - :p:`fls_to4e7imq2c0w` + * New paragraph: :p:`fls_ooOYxhVh8hZo` - - :p:`fls_6g7c1kjrmfnr` - - - :p:`fls_hkbwa8xx2fwx` - - - :p:`fls_ox6sgl9n43g2` + * Removed paragraph: :p:`fls_ox6sgl9n43g2` * `Allow creating references to statics in \`const\` initializers. `_ diff --git a/src/values.rst b/src/values.rst index 37190235..07bb7bfa 100644 --- a/src/values.rst +++ b/src/values.rst @@ -95,7 +95,7 @@ The :t:`type specification` of a :t:`constant` shall have ``'static`` The :t:`type` of a :t:`constant` shall implement the :std:`core::marker::Sized` :t:`trait`. -:dp:`fls_ox6sgl9n43g2` +:dp:`fls_ooOYxhVh8hZo` The type of a :t:`constant` cannot be a :t:`mutable reference type`. :dp:`fls_ndmfqxjpvsqy` From 00c1bfd4898442e0a03a4521a4352187bd70178b Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 18 Oct 2025 15:50:36 +0200 Subject: [PATCH 7/9] add restrictions on constant expressions --- src/changelog.rst | 1 + src/expressions.rst | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/changelog.rst b/src/changelog.rst index 6e573083..e9b5fd5a 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -29,6 +29,7 @@ Language changes in Rust 1.90.0 - This lifted restriction was not specified in the FLS - The restriction on patterns is documented in :p:`fls_wJ9f906BlBvg` + - New paragraph: :p:`fls_zyuxqty09SDO` - `Allow volatile access to non-Rust memory, including address 0 `_ diff --git a/src/expressions.rst b/src/expressions.rst index 381d6f4f..065892b2 100644 --- a/src/expressions.rst +++ b/src/expressions.rst @@ -312,6 +312,12 @@ A :t:`constant context` is a :t:`construct` that requires a * :dp:`fls_ucFupTeCyylb` The :t:`block expression` of a :t:`const block expression`. +* :dp:`fls_zyuxqty09SDO` + All forms of :t:`[borrow]s` except those of expressions that would be subject to + :t:`drop scope extension`, + and which are either :t:`[mutable borrow]s` + or borrows of expressions that result in values with :t:`interior mutability`. + :dp:`fls_od0h3v40kjp6` An invocation of the :std:`core::ptr::addr_of` :t:`macro` expands to a :t:`constant expression` allowed in any :t:`constant context` and From d2614998da04f402f8afde8839eb948e0b662c29 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 25 Oct 2025 22:48:57 +0200 Subject: [PATCH 8/9] lifetime extension here applies to static lifetimes --- src/expressions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expressions.rst b/src/expressions.rst index 065892b2..7c8f06d4 100644 --- a/src/expressions.rst +++ b/src/expressions.rst @@ -314,7 +314,7 @@ A :t:`constant context` is a :t:`construct` that requires a * :dp:`fls_zyuxqty09SDO` All forms of :t:`[borrow]s` except those of expressions that would be subject to - :t:`drop scope extension`, + :t:`drop scope extension` to the end of the program and which are either :t:`[mutable borrow]s` or borrows of expressions that result in values with :t:`interior mutability`. From 6465ff2e081338b4db1b17153315ff08720ebcb5 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 25 Oct 2025 22:53:40 +0200 Subject: [PATCH 9/9] stronger wording --- src/expressions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expressions.rst b/src/expressions.rst index 7c8f06d4..01bcf179 100644 --- a/src/expressions.rst +++ b/src/expressions.rst @@ -313,7 +313,7 @@ A :t:`constant context` is a :t:`construct` that requires a The :t:`block expression` of a :t:`const block expression`. * :dp:`fls_zyuxqty09SDO` - All forms of :t:`[borrow]s` except those of expressions that would be subject to + All forms of :t:`[borrow]s` except those of expressions that are subject to :t:`drop scope extension` to the end of the program and which are either :t:`[mutable borrow]s` or borrows of expressions that result in values with :t:`interior mutability`.