From efc3c1ca5ead94dcd000947461b252ec35cfaee0 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Thu, 16 Apr 2026 13:20:21 +0200 Subject: [PATCH 1/2] not all functions implement Fn traits --- src/changelog.rst | 7 +++++++ src/types-and-traits.rst | 9 ++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/changelog.rst b/src/changelog.rst index 09c9ae55..f3a14f72 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -36,6 +36,13 @@ Language changes in Rust 1.95.0 - `Const blocks are no longer evaluated to determine if expressions involving fallible operations can implicitly be constant-promoted `_ - `Make operational semantics of pattern matching independent of crate and module `_ +FLS corrections +--------------- + +Changed paragraph: :p:`fls_1941wid94hlg` + +New paragraph: :p:`fls_CSuxTkwR96j9` + Language changes in Rust 1.94.0 ------------------------------- diff --git a/src/types-and-traits.rst b/src/types-and-traits.rst index 9efa58dd..db8bb1bf 100644 --- a/src/types-and-traits.rst +++ b/src/types-and-traits.rst @@ -926,11 +926,10 @@ An :t:`unsafe function item type` is a :t:`function item type` where the related A :t:`function item type` is coercible to a :t:`function pointer type`. :dp:`fls_1941wid94hlg` -A :t:`function item type` implements the :std:`core::clone::Clone` :t:`trait`, -the :std:`core::marker::Copy` :t:`trait`, the :std:`core::ops::Fn` :t:`trait`, -the :std:`core::ops::FnMut` :t:`trait`, the :std:`core::ops::FnOnce` :t:`trait`, -the :std:`core::marker::Send` :t:`trait`, and the :std:`core::marker::Sync` -:t:`trait`. +A :t:`function item type` implements the :std:`core::clone::Clone` :t:`trait`, the :std:`core::marker::Copy` :t:`trait`, the :std:`core::marker::Send` :t:`trait`, and the :std:`core::marker::Sync` :t:`trait`. + +:dp:`fls_CSuxTkwR96j9` +A :t:`function item type` implements the :std:`core::ops::Fn` :t:`trait`, the :std:`core::ops::FnMut` :t:`trait`, the :std:`core::ops::FnOnce` :t:`trait`, unless it is an :t:`unsafe function`, unless it has :t:`attribute` :c:`target_feature`, or unless it does not have a :t:`Rust ABI`. .. _fls_3i4ou0dq64ny: From 2466a0cfb615c9fceb8a592476cf246fe443957a Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Tue, 21 Apr 2026 11:29:27 +0200 Subject: [PATCH 2/2] readability Co-authored-by: Hristian Kirtchev <60669983+kirtchev-adacore@users.noreply.github.com> --- src/types-and-traits.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/types-and-traits.rst b/src/types-and-traits.rst index db8bb1bf..73768350 100644 --- a/src/types-and-traits.rst +++ b/src/types-and-traits.rst @@ -929,7 +929,10 @@ A :t:`function item type` is coercible to a :t:`function pointer type`. A :t:`function item type` implements the :std:`core::clone::Clone` :t:`trait`, the :std:`core::marker::Copy` :t:`trait`, the :std:`core::marker::Send` :t:`trait`, and the :std:`core::marker::Sync` :t:`trait`. :dp:`fls_CSuxTkwR96j9` -A :t:`function item type` implements the :std:`core::ops::Fn` :t:`trait`, the :std:`core::ops::FnMut` :t:`trait`, the :std:`core::ops::FnOnce` :t:`trait`, unless it is an :t:`unsafe function`, unless it has :t:`attribute` :c:`target_feature`, or unless it does not have a :t:`Rust ABI`. +A :t:`function item type` implements the :std:`core::ops::Fn` :t:`trait`, the :std:`core::ops::FnMut` :t:`trait`, the :std:`core::ops::FnOnce` :t:`trait`, unless the corresponding :t:`function` +- is an :t:`unsafe function`, or +- has :t:`attribute` :c:`target_feature`, or +- does not have a :t:`Rust ABI`. .. _fls_3i4ou0dq64ny: