2022-04-11 16:38:48 +00:00
|
|
|
error[E0277]: the trait bound `String: Copy` is not satisfied
|
|
|
|
|
--> $DIR/trait-error.rs:5:6
|
2019-06-12 08:46:56 +01:00
|
|
|
|
|
|
|
|
|
LL | [Foo(String::new()); 4];
|
2025-06-04 21:39:29 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
|
2019-06-12 08:46:56 +01:00
|
|
|
|
|
2022-08-15 21:31:37 +01:00
|
|
|
note: required for `Foo<String>` to implement `Copy`
|
2022-04-11 16:38:48 +00:00
|
|
|
--> $DIR/trait-error.rs:1:10
|
|
|
|
|
|
|
|
|
|
|
LL | #[derive(Copy, Clone)]
|
2023-01-11 03:21:11 +00:00
|
|
|
| ^^^^ unsatisfied trait bound introduced in this `derive` macro
|
2022-04-28 09:40:42 +00:00
|
|
|
= note: the `Copy` trait is required because this value will be copied for each element of the array
|
2025-06-04 21:39:29 +00:00
|
|
|
help: create an inline `const` block
|
|
|
|
|
|
|
|
|
|
|
LL | [const { Foo(String::new()) }; 4];
|
|
|
|
|
| +++++++ +
|
2019-06-12 08:46:56 +01:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2019-06-12 08:46:56 +01:00
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|