2025-05-26 16:35:36 +01:00
|
|
|
error[E0277]: the trait bound `String: Copy` is not satisfied
|
2025-06-11 15:30:15 +01:00
|
|
|
--> $DIR/copy-check-when-count-inferred-later.rs:6:14
|
2025-05-26 16:35:36 +01:00
|
|
|
|
|
|
|
|
|
LL | let a = [String::new(); _];
|
2025-06-04 21:39:29 +00:00
|
|
|
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
|
2025-05-26 16:35:36 +01: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 | let a = [const { String::new() }; _];
|
|
|
|
|
| +++++++ +
|
2025-05-26 16:35:36 +01:00
|
|
|
|
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|