Skip to content

Commit b4485d8

Browse files
committed
opt-in-copy
1 parent 8e8dbc2 commit b4485d8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/ui/traits/copy-requires-all-fields-copy.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Test that `Copy` cannot be implemented if any field doesn't implement `Copy`.
2+
13
struct CantCopyThis;
24

35
struct IWantToCopyThis {

tests/ui/traits/copy-requires-all-fields-copy.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0204]: the trait `Copy` cannot be implemented for this type
2-
--> $DIR/opt-in-copy.rs:7:15
2+
--> $DIR/copy-requires-all-fields-copy.rs:9:15
33
|
44
LL | but_i_cant: CantCopyThis,
55
| ------------------------ this field does not implement `Copy`
@@ -8,7 +8,7 @@ LL | impl Copy for IWantToCopyThis {}
88
| ^^^^^^^^^^^^^^^
99

1010
error[E0204]: the trait `Copy` cannot be implemented for this type
11-
--> $DIR/opt-in-copy.rs:19:15
11+
--> $DIR/copy-requires-all-fields-copy.rs:21:15
1212
|
1313
LL | ButICant(CantCopyThisEither),
1414
| ------------------ this field does not implement `Copy`

0 commit comments

Comments
 (0)