Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
15 changes: 15 additions & 0 deletions src/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/rust-lang/rust/pull/140717>`_

- 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 <https://github.com/rust-lang/rust/pull/140942>`_

- New paragraph: :p:`fls_wJ9f906BlBvg`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I read things correctly that we don't need to relax the legality rules for constants in 7.1 because they already did not state the restriction against references to mutable places? (Should the changelog say that?)

Similarly, there's no legality rule in 7.1 restricting against mutable references in the final value of a constant. Is that leaning instead on the rule in chapter 6, fls_ox6sgl9n43g2, that:

It is a static error to create a :t:mutable reference in a :t:constant context.

?

Note, however, that rule is wrong:

const _: () = { _ = &mut 0; () }; // OK

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, are we missing the rule against shared references to interior mutable lifetime-extended temporaries in the final value of a constant?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@traviscross -- by:

Similarly, are we missing the rule against shared references to interior mutable lifetime-extended temporaries in the final value of a constant?

You refer here to this portion of the Reference, inside the Note?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I read things correctly that we don't need to relax the legality rules for constants in 7.1 because they already did not state the restriction against references to mutable places? (Should the changelog say that?)

oh, indeed, the changelog can say that

Similarly, there's no legality rule in 7.1 restricting against mutable references in the final value of a constant. Is that leaning instead on the rule in chapter 6, fls_ox6sgl9n43g2, that:

It is a static error to create a :t:mutable reference in a :t:constant context.

?

Note, however, that rule is wrong:

const _: () = { _ = &mut 0; () }; // OK

let me submit a change fixing this

Copy link
Member Author

@tshepang tshepang Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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

- No change: lints are not part of the FLS

Language changes in Rust 1.89.0
-------------------------------

Expand Down
6 changes: 6 additions & 0 deletions src/patterns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding some traceability here to the Reference PR portion which means the FLS need be updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is meant by "need be updated"

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
Expand Down
2 changes: 1 addition & 1 deletion version.rst
Original file line number Diff line number Diff line change
@@ -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