2020-09-02 10:40:56 +03:00
|
|
|
error[E0277]: the trait bound `T: Copy` is not satisfied
|
2022-04-11 16:38:48 +00:00
|
|
|
--> $DIR/issue-61336-2.rs:6:6
|
2019-06-13 17:19:50 +01:00
|
|
|
|
|
2020-03-14 15:30:35 +01:00
|
|
|
LL | [x; { N }]
|
2022-04-11 16:38:48 +00:00
|
|
|
| ^ the trait `Copy` is not implemented for `T`
|
2020-03-14 15:30:35 +01:00
|
|
|
|
|
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
|
2024-01-05 10:25:20 +08:00
|
|
|
= help: consider using `core::array::from_fn` to initialize the array
|
2024-01-24 00:08:43 +01:00
|
|
|
= help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information
|
2024-11-28 20:22:46 +00:00
|
|
|
help: consider restricting type parameter `T` with trait `Copy`
|
2020-03-13 19:28:14 -07:00
|
|
|
|
|
2021-03-30 17:56:39 +08:00
|
|
|
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
|
2021-06-21 19:07:19 -07:00
|
|
|
| +++++++++++++++++++
|
2019-06-13 17:19:50 +01:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2019-06-13 17:19:50 +01:00
|
|
|
|
2020-03-14 15:30:35 +01:00
|
|
|
For more information about this error, try `rustc --explain E0277`.
|