]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-34721.stderr
Use structured suggestion when requiring `Copy` constraint in type param
[rust.git] / src / test / ui / issues / issue-34721.stderr
1 error[E0382]: use of moved value: `x`
2   --> $DIR/issue-34721.rs:27:9
3    |
4 LL |     pub fn baz<T: Foo>(x: T) -> T {
5    |                --      - move occurs because `x` has type `T`, which does not implement the `Copy` trait
6    |                |
7    |                help: consider adding a `Copy` constraint to this type argument: `T: Copy +`
8 LL |         if 0 == 1 {
9 LL |             bar::bar(x.zero())
10    |                      - value moved here
11 LL |         } else {
12 LL |             x.zero()
13    |             - value moved here
14 LL |         };
15 LL |         x.zero()
16    |         ^ value used here after move
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0382`.