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