Skip to content

Commit 3024eff

Browse files
committed
Update Copy/Clone documentation WRT arrays
1 parent ce1143e commit 3024eff

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

compiler/rustc_error_codes/src/error_codes/E0206.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ enum.
44
Erroneous code example:
55

66
```compile_fail,E0206
7-
type Foo = [u8; 256];
8-
impl Copy for Foo { } // error!
9-
107
#[derive(Copy, Clone)]
118
struct Bar;
129
1310
impl Copy for &'static mut Bar { } // error!
1411
```
1512

16-
You can only implement `Copy` for a struct or an enum. Both of the previous
17-
examples will fail, because neither `[u8; 256]` nor `&'static mut Bar`
18-
(mutable reference to `Bar`) is a struct or enum.
13+
You can only implement `Copy` for a struct or an enum.
14+
The previous example will fail because `&'static mut Bar`
15+
is not a struct or enum.

library/core/src/clone.rs

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
///
9494
/// * Function item types (i.e., the distinct types defined for each function)
9595
/// * Function pointer types (e.g., `fn() -> i32`)
96-
/// * Array types, for all sizes, if the item type also implements `Clone` (e.g., `[i32; 123456]`)
9796
/// * Tuple types, if each component also implements `Clone` (e.g., `()`, `(i32, bool)`)
9897
/// * Closure types, if they capture no value from the environment
9998
/// or if all such captured values implement `Clone` themselves.

library/core/src/marker.rs

-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ pub trait StructuralEq {
359359
///
360360
/// * Function item types (i.e., the distinct types defined for each function)
361361
/// * Function pointer types (e.g., `fn() -> i32`)
362-
/// * Array types, for all sizes, if the item type also implements `Copy` (e.g., `[i32; 123456]`)
363362
/// * Tuple types, if each component also implements `Copy` (e.g., `()`, `(i32, bool)`)
364363
/// * Closure types, if they capture no value from the environment
365364
/// or if all such captured values implement `Copy` themselves.

0 commit comments

Comments
 (0)