@@ -2,45 +2,36 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
2
2
--> $DIR/const-fn-in-vec.rs:1:47
3
3
|
4
4
LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5];
5
- | ^^^^ the trait `Copy` is not implemented for `String`, which is required by `Option<String>: Copy`
5
+ | ^^^^
6
+ | |
7
+ | the trait `Copy` is not implemented for `String`, which is required by `Option<String>: Copy`
8
+ | help: create an inline `const` block: `const { None }`
6
9
|
7
10
= note: required for `Option<String>` to implement `Copy`
8
11
= note: the `Copy` trait is required because this value will be copied for each element of the array
9
- = help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
10
- help: consider creating a new `const` item and initializing it with the result of the constructor to be used in the repeat position
11
- |
12
- LL + const ARRAY_REPEAT_VALUE: Option<String> = None;
13
- LL ~ static _MAYBE_STRINGS: [Option<String>; 5] = [ARRAY_REPEAT_VALUE; 5];
14
- |
15
12
16
13
error[E0277]: the trait bound `String: Copy` is not satisfied
17
14
--> $DIR/const-fn-in-vec.rs:7:34
18
15
|
19
16
LL | let _strings: [String; 5] = [String::new(); 5];
20
- | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
17
+ | ^^^^^^^^^^^^^
18
+ | |
19
+ | the trait `Copy` is not implemented for `String`
20
+ | help: create an inline `const` block: `const { String::new() }`
21
21
|
22
22
= note: the `Copy` trait is required because this value will be copied for each element of the array
23
- = help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
24
- help: consider creating a new `const` item and initializing it with the result of the function call to be used in the repeat position
25
- |
26
- LL ~ const ARRAY_REPEAT_VALUE: String = String::new();
27
- LL ~ let _strings: [String; 5] = [ARRAY_REPEAT_VALUE; 5];
28
- |
29
23
30
24
error[E0277]: the trait bound `String: Copy` is not satisfied
31
25
--> $DIR/const-fn-in-vec.rs:9:48
32
26
|
33
27
LL | let _maybe_strings: [Option<String>; 5] = [None; 5];
34
- | ^^^^ the trait `Copy` is not implemented for `String`, which is required by `Option<String>: Copy`
28
+ | ^^^^
29
+ | |
30
+ | the trait `Copy` is not implemented for `String`, which is required by `Option<String>: Copy`
31
+ | help: create an inline `const` block: `const { None }`
35
32
|
36
33
= note: required for `Option<String>` to implement `Copy`
37
34
= note: the `Copy` trait is required because this value will be copied for each element of the array
38
- = help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
39
- help: consider creating a new `const` item and initializing it with the result of the constructor to be used in the repeat position
40
- |
41
- LL ~ const ARRAY_REPEAT_VALUE: Option<String> = None;
42
- LL ~ let _maybe_strings: [Option<String>; 5] = [ARRAY_REPEAT_VALUE; 5];
43
- |
44
35
45
36
error: aborting due to 3 previous errors
46
37
0 commit comments