rust/src/test/ui/consts/const-blocks/fn-call-in-non-const.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
850 B
Plaintext
Raw Normal View History

error[E0277]: the trait bound `Option<Bar>: Copy` is not satisfied
2021-01-26 16:49:30 -06:00
--> $DIR/fn-call-in-non-const.rs:14:31
2019-06-13 11:30:49 -05:00
|
LL | let _: [Option<Bar>; 2] = [no_copy(); 2];
| ^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Option<Bar>`
2019-06-13 11:30:49 -05:00
|
= help: the trait `Copy` is implemented for `Option<T>`
2019-06-13 11:30:49 -05:00
= note: the `Copy` trait is required because the repeated element will be copied
= help: consider creating a new `const` item and initializing it with the result of the function call to be used in the repeat position, like `const VAL: Type = const_fn();` and `let x = [VAL; 42];`
= help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
2019-06-13 11:30:49 -05:00
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.