diff --git a/src/attributes.rst b/src/attributes.rst index 7a16b6ac..4a10ddd6 100644 --- a/src/attributes.rst +++ b/src/attributes.rst @@ -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`. @@ -2373,4 +2376,3 @@ the exhaustiveness of :t:`[match arm]s`. struct struct_with_future_fields { field: u32 } - diff --git a/src/changelog.rst b/src/changelog.rst index e9baad4c..6181ba1f 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -34,6 +34,13 @@ Language changes in Rust 1.93.0 - `Stabilize asm_cfg `_ - `During const-evaluation, support copying pointers byte-by-byte `_ - `LUB coercions now correctly handle function item types, and functions with differing safeties `_ + + - 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) `_ * Removed paragraph: :p:`fls_ooOYxhVh8hZo` diff --git a/src/types-and-traits.rst b/src/types-and-traits.rst index a70989a5..724133c6 100644 --- a/src/types-and-traits.rst +++ b/src/types-and-traits.rst @@ -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 @@ -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.