]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-34721.stderr
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[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 LL |         if 0 == 1 {
7 LL |             bar::bar(x.zero())
8    |                        ------ `x` moved due to this method call
9 LL |         } else {
10 LL |             x.zero()
11    |               ------ `x` moved due to this method call
12 LL |         };
13 LL |         x.zero()
14    |         ^ value used here after move
15    |
16 note: this function takes ownership of the receiver `self`, which moves `x`
17   --> $DIR/issue-34721.rs:4:13
18    |
19 LL |     fn zero(self) -> Self;
20    |             ^^^^
21 help: consider further restricting this bound
22    |
23 LL |     pub fn baz<T: Foo + Copy>(x: T) -> T {
24    |                       ++++++
25
26 error: aborting due to previous error
27
28 For more information about this error, try `rustc --explain E0382`.