Skip to content

Commit 46e5bc8

Browse files
authored
Merge pull request #1969 from ehuss/fix-fn-traits
Fix traits implemented for function items
2 parents 82c9863 + ad44a99 commit 46e5bc8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/types/function-item.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ let foo_ptr_2 = if want_i32 {
5050
```
5151

5252
r[type.fn-item.traits]
53-
All function items implement [`Fn`], [`FnMut`], [`FnOnce`], [`Copy`],
54-
[`Clone`], [`Send`], and [`Sync`].
53+
All function items implement [`Copy`], [`Clone`], [`Send`], and [`Sync`].
54+
55+
[`Fn`], [`FnMut`], and [`FnOnce`] are implemented unless the function has any of the following:
56+
57+
- an [`unsafe`][unsafe.fn] qualifier
58+
- a [`target_feature` attribute][attributes.codegen.target_feature]
59+
- an [ABI][items.fn.extern] other than `"Rust"`
5560

5661
[`Clone`]: ../special-types-and-traits.md#clone
5762
[`Copy`]: ../special-types-and-traits.md#copy

0 commit comments

Comments
 (0)