Change:
error[E0277]: the trait bound `String: Copy` is not satisfied <del> --> $DIR/const-fn-in-vec.rs:4:33 </del> <ins> --> $DIR/const-fn-in-vec.rs:1:47 </ins> | <del> LL |     let strings: [String; 5] = [String::new(); 5]; |                                 ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` </del> <ins> LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; |                                               ^^^^ the trait `Copy` is not implemented for `String` </ins> | <ins> = note: required for `Option<String>` to implement `Copy` </ins> = note: the `Copy` trait is required because this value will be copied for each element of the array <del> = 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];` </del> = help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information <ins> help: consider creating a new `const` item and initializing it with the result of the constructor to be used in the repeat position | LL + const ARRAY_REPEAT_VALUE: Option<String> = None; LL ~ static _MAYBE_STRINGS: [Option<String>; 5] = [ARRAY_REPEAT_VALUE; 5]; | error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:7:34 | LL |     let _strings: [String; 5] = [String::new(); 5]; |                                  ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | = note: the `Copy` trait is required because this value will be copied for each element of the array = help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information help: consider creating a new `const` item and initializing it with the result of the function call to be used in the repeat position | LL ~     const ARRAY_REPEAT_VALUE: String = String::new(); LL ~     let _strings: [String; 5] = [ARRAY_REPEAT_VALUE; 5]; | error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:9:48 | LL |     let _maybe_strings: [Option<String>; 5] = [None; 5]; |                                                ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array = help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information help: consider creating a new `const` item and initializing it with the result of the constructor to be used in the repeat position | LL ~     const ARRAY_REPEAT_VALUE: Option<String> = None; LL ~     let _maybe_strings: [Option<String>; 5] = [ARRAY_REPEAT_VALUE; 5]; | </ins> <del> error: aborting due to previous error </del> <ins> error: aborting due to 3 previous errors </ins> For more information about this error, try `rustc --explain E0277`.

Discussion:
I'm basing this suggestion on two things. One, that if you follow it, the code compiles: and two, that the diagnostic help you get when you try to use a in the repeat position suggests something very similar, see "other cases." It would require the compiler to know that a value that is attempted to be repeated is able though, which I don't know whether it can, but I figured I'd suggest this, and you can reject it if it isn't possible to do. Alternatively, the help text could say something like "if the value can be made , consider creating [...]" I was inspired to make this issue based on the output you get when you try to use a as an array initializer. For instance, the code produces the output No response
hey why im getting this error message all over my github repository ! whenever i commit some changes, The first changes i able to create pull request but after some other changes im not able to do that why im getting these error ! Please help
I don't think your comment is related to this issue? If this is a problem you've encountered while trying to fix this issue, please reach out on instead.