You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= note: required for `Option<Bar>` to implement `Copy`
8
8
= note: the `Copy` trait is required because this value will be copied for each element of the array
9
-
= 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];`
10
9
= help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
11
10
help: consider annotating `Bar` with `#[derive(Copy)]`
12
11
|
13
12
LL + #[derive(Copy)]
14
13
LL | struct Bar;
15
14
|
15
+
help: consider creating a new `const` item and initializing it with the result of the function call to be used in the repeat position
Copy file name to clipboardexpand all lines: tests/ui/consts/const-blocks/trait-error.stderr
+5-1
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,13 @@ note: required for `Foo<String>` to implement `Copy`
10
10
LL | #[derive(Copy, Clone)]
11
11
| ^^^^ unsatisfied trait bound introduced in this `derive` macro
12
12
= note: the `Copy` trait is required because this value will be copied for each element of the array
13
-
= 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];`
14
13
= help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
15
14
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
15
+
help: consider creating a new `const` item and initializing it with the result of the function call to be used in the repeat position
| ^^^^ the trait `Copy` is not implemented for `String`
6
6
|
7
+
= note: required for `Option<String>` to implement `Copy`
7
8
= note: the `Copy` trait is required because this value will be copied for each element of the array
8
-
= 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];`
9
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
0 commit comments