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