fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0382]: use of moved value: `x` 2 --> $DIR/issue-34721.rs:27:9 3 | 4LL | pub fn baz<T: Foo>(x: T) -> T { 5 | - move occurs because `x` has type `T`, which does not implement the `Copy` trait 6LL | if 0 == 1 { 7LL | bar::bar(x.zero()) 8 | ------ `x` moved due to this method call 9LL | } else { 10LL | x.zero() 11 | ------ `x` moved due to this method call 12LL | }; 13LL | x.zero() 14 | ^ value used here after move 15 | 16note: `Foo::zero` takes ownership of the receiver `self`, which moves `x` 17 --> $DIR/issue-34721.rs:4:13 18 | 19LL | fn zero(self) -> Self; 20 | ^^^^ 21help: consider further restricting this bound 22 | 23LL | pub fn baz<T: Foo + Copy>(x: T) -> T { 24 | ++++++ 25 26error: aborting due to previous error 27 28For more information about this error, try `rustc --explain E0382`.