From c3bf599d34789203c66b243f76411929238f7b2a Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Sun, 11 Oct 2026 19:40:04 -0400 Subject: [PATCH] Document `Fn` traits implemented for all ABIs --- src/types/function-item.md | 7 +++---- src/types/function-pointer.md | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/types/function-item.md b/src/types/function-item.md index 1be2efa156..f3e89364fa 100644 --- a/src/types/function-item.md +++ b/src/types/function-item.md @@ -37,18 +37,17 @@ let foo_ptr_2 = if want_i32 { ``` r[type.fn-item.traits] -All function items implement [`Copy`], [`Clone`], [`Send`], and [`Sync`]. +All function items implement [`Copy`], [`Clone`], and all the [auto traits][lang-types.auto-traits]. [`Fn`], [`FnMut`], and [`FnOnce`] are implemented unless the function has any of the following: - an [`unsafe`][unsafe.fn] qualifier - a [`target_feature` attribute][attributes.codegen.target_feature] -- an [ABI][items.fn.extern] other than `"Rust"` +- an [ABI][items.fn.extern] of `"custom"` +- a [C-variadic][items.fn.c-variadic] rest parameter [`Clone`]: ../special-types-and-traits.md#clone [`Copy`]: ../special-types-and-traits.md#copy -[`Send`]: ../special-types-and-traits.md#send -[`Sync`]: ../special-types-and-traits.md#sync [coercion]: ../type-coercions.md [function pointers]: function-pointer.md [zero-sized]: glossary.zst diff --git a/src/types/function-pointer.md b/src/types/function-pointer.md index 70db496571..1f36b098da 100644 --- a/src/types/function-pointer.md +++ b/src/types/function-pointer.md @@ -53,6 +53,9 @@ For the function to be variadic, its `extern` ABI must be one of those listed in r[type.fn-pointer.extern-custom] An `extern "custom"` function pointer must follow the rules in [items.fn.extern.custom.signature]. +r[type.fn-pointer.traits] +A function pointer implements [the same traits][type.fn-item.traits] as a function item with the same signature. + r[type.fn-pointer.attributes] ## Attributes on function pointer parameters