2022-04-11 16:38:48 +00:00
|
|
|
error[E0277]: the trait bound `Bar: Copy` is not satisfied
|
|
|
|
|
--> $DIR/fn-call-in-non-const.rs:14:32
|
2019-06-13 17:30:49 +01:00
|
|
|
|
|
2019-11-22 10:45:49 -08:00
|
|
|
LL | let _: [Option<Bar>; 2] = [no_copy(); 2];
|
2024-10-24 21:14:17 +00:00
|
|
|
| ^^^^^^^^^ the trait `Copy` is not implemented for `Bar`
|
2019-06-13 17:30:49 +01:00
|
|
|
|
|
2022-08-15 21:31:37 +01:00
|
|
|
= note: required for `Option<Bar>` to implement `Copy`
|
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
|
2022-04-11 16:38:48 +00:00
|
|
|
help: consider annotating `Bar` with `#[derive(Copy)]`
|
|
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + #[derive(Copy)]
|
|
|
|
|
LL | struct Bar;
|
2022-04-11 16:38:48 +00:00
|
|
|
|
|
2024-06-24 15:30:24 +03:00
|
|
|
help: create an inline `const` block
|
2023-07-21 15:59:28 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - let _: [Option<Bar>; 2] = [no_copy(); 2];
|
|
|
|
|
LL + let _: [Option<Bar>; 2] = [const { no_copy() }; 2];
|
|
|
|
|
|
|
2019-06-13 17:30:49 +01:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2019-06-13 17:30:49 +01:00
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|