Skip to content

Commit f6889fc

Browse files
committed
Update list of types with magic Copy impls
Numeric types, char, bool, `!`, shared references, and raw pointers all have ordinary Copy impls in std, not provided by the compiler. Also, mention closures here.
1 parent a01d151 commit f6889fc

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/special-types-and-traits.md

+5-10
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,11 @@ For unions, this means all variants have to be `Copy`.
6767

6868
`Copy` is implemented by the compiler for
6969

70-
* [Numeric types]
71-
* `char`, `bool`, and [`!`]
7270
* [Tuples] of `Copy` types
7371
* [Arrays] of `Copy` types
74-
* [Shared references]
75-
* [Raw pointers]
76-
* [Function pointers] and [function item types]
72+
* [Function pointers]
73+
* [Function items]
74+
* [Closures] that capture no values or that only capture values of `Copy` types.
7775

7876
## `Clone`
7977

@@ -168,21 +166,18 @@ These implicit `Sized` bounds may be relaxed by using the special `?Sized` bound
168166
[drop check]: ../nomicon/dropck.html
169167
[dynamically sized type]: dynamically-sized-types.md
170168
[Function pointers]: types/function-pointer.md
171-
[function item types]: types/function-item.md
169+
[Function items]: types/function-item.md
172170
[implementation items]: items/implementations.md
173171
[indexing expressions]: expressions/array-expr.md#array-and-slice-indexing-expressions
174172
[interior mutability]: interior-mutability.md
175-
[Numeric types]: types/numeric.md
176173
[Methods]: items/associated-items.md#associated-functions-and-methods
177174
[method resolution]: expressions/method-call-expr.md
178175
[operators]: expressions/operator-expr.md
179176
[orphan rules]: items/implementations.md#trait-implementation-coherence
180-
[Raw pointers]: types/pointer.md#raw-pointers-const-and-mut
181177
[`static` items]: items/static-items.md
182-
[Shared references]: types/pointer.md#shared-references-
183178
[the standard library]: ../std/index.html
184179
[trait object]: types/trait-object.md
185180
[Tuples]: types/tuple.md
186181
[Type parameters]: types/parameters.md
187182
[variance]: subtyping.md#variance
188-
[`!`]: types/never.md
183+
[Closures]: types/closure.md

0 commit comments

Comments
 (0)