fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
741 B23 linesraw
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   |                      - value moved here
9LL |         } else {
10LL |             x.zero()
11   |             - value moved here
12LL |         };
13LL |         x.zero()
14   |         ^ value used here after move
15   |
16help: consider further restricting this bound
17   |
18LL |     pub fn baz<T: Foo + Copy>(x: T) -> T {
19   |                       ^^^^^^
20
21error: aborting due to previous error
22
23For more information about this error, try `rustc --explain E0382`.