Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/attributes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,9 @@ Safe :t:`[function]s` that are annotated with :c:`[target_feature]s`
can only be called without an :t:`unsafe block` by a caller that is within a function
that enables all the :c:`[target_feature]s` that the callee enables.

:dp:`fls_ReYuWzijQ1aL`
A safe :t:`[function]` that is annotated with :c:`[target_feature]s` shall only be coerced to a :t:`function pointer type` that lacks :t:`keyword` ``unsafe`` at a :t:`coercion site` within a :t:`function` that enables all the :c:`[target_feature]s` that the source enables; otherwise it may only be coerced to an :t:`unsafe function pointer type`.

:dp:`fls_agpkz1v3c281`
:t:`Attribute` :dc:`target_feature` enables target architecture features for its
related :t:`function`.
Expand Down Expand Up @@ -2373,4 +2376,3 @@ the exhaustiveness of :t:`[match arm]s`.
struct struct_with_future_fields {
field: u32
}

7 changes: 7 additions & 0 deletions src/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ Language changes in Rust 1.93.0
- `Stabilize asm_cfg <https://github.com/rust-lang/rust/pull/147736>`_
- `During const-evaluation, support copying pointers byte-by-byte <https://github.com/rust-lang/rust/pull/148259>`_
- `LUB coercions now correctly handle function item types, and functions with differing safeties <https://github.com/rust-lang/rust/pull/148602>`_

- New paragraphs:

- :p:`fls_ReYuWzijQ1aL`
- :p:`fls_yhtOWsxAcccM`
- :p:`fls_rRegjSIudDM1`

- `Allow const items that contain mutable references to static (which is *very* unsafe, but not *always* UB) <https://github.com/rust-lang/rust/pull/148746>`_

* Removed paragraph: :p:`fls_ooOYxhVh8hZo`
Expand Down
6 changes: 6 additions & 0 deletions src/types-and-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,9 @@ occur when:
and the target :t:`type` is a :t:`trait object type` with some :t:`principal trait` ``U``,
where ``U`` is a :t:`supertrait` of ``T``.

:dp:`fls_yhtOWsxAcccM`
A :t:`function signature` is a :t:`subtype` of another :t:`function signature` when they are identical except that the subtype lacks :t:`keyword` ``unsafe`` where the supertype uses :t:`keyword` ``unsafe`` in its :t:`function qualifier` list.

:dp:`fls_iiiu2q7pym4p`
An :t:`unsized coercion` is a :t:`type coercion` that converts a :t:`sized type`
into an :t:`unsized type`. :t:`Unsized coercion` from a source :t:`type` to a
Expand Down Expand Up @@ -2148,6 +2151,9 @@ obtained as follows:
that both ``TC`` and ``U`` can coerce to, make that
:t:`function pointer type` be target :t:`type` ``U``.

#. :dp:`fls_rRegjSIudDM1`
When applying the previous step, select a :t:`function pointer type` without :t:`keyword` ``unsafe`` only when each source :t:`type` can coerce to a :t:`function pointer type` without :t:`keyword` ``unsafe`` at the :t:`coercion site`; otherwise select an :t:`unsafe function pointer type`.

#. :dp:`fls_bWHQIL4DSN4S`
Otherwise, no coercion is performed.

Expand Down