fork/rust

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

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

1.44.0
2.2 KiB63 linesraw
1error[E0382]: use of moved value: `y`
2  --> $DIR/double-move.rs:20:22
3   |
4LL |         let y = *x;
5   |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
6LL |         drop_unsized(y);
7   |                      - value moved here
8LL |         drop_unsized(y);
9   |                      ^ value used here after move
10
11error[E0382]: use of moved value: `x`
12  --> $DIR/double-move.rs:26:22
13   |
14LL |         let _y = *x;
15   |                  -- value moved here
16LL |         drop_unsized(x);
17   |                      ^ value used here after partial move
18   |
19   = note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
20
21error[E0382]: use of moved value: `*x`
22  --> $DIR/double-move.rs:32:18
23   |
24LL |         let x = "hello".to_owned().into_boxed_str();
25   |             - move occurs because `x` has type `std::boxed::Box<str>`, which does not implement the `Copy` trait
26LL |         drop_unsized(x);
27   |                      - value moved here
28LL |         let _y = *x;
29   |                  ^^ value used here after move
30
31error[E0382]: use of moved value: `y`
32  --> $DIR/double-move.rs:39:9
33   |
34LL |         let y = *x;
35   |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
36LL |         y.foo();
37   |         - value moved here
38LL |         y.foo();
39   |         ^ value used here after move
40
41error[E0382]: use of moved value: `x`
42  --> $DIR/double-move.rs:45:9
43   |
44LL |         let _y = *x;
45   |                  -- value moved here
46LL |         x.foo();
47   |         ^ value used here after partial move
48   |
49   = note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
50
51error[E0382]: use of moved value: `*x`
52  --> $DIR/double-move.rs:51:18
53   |
54LL |         let x = "hello".to_owned().into_boxed_str();
55   |             - move occurs because `x` has type `std::boxed::Box<str>`, which does not implement the `Copy` trait
56LL |         x.foo();
57   |         - value moved here
58LL |         let _y = *x;
59   |                  ^^ value used here after move
60
61error: aborting due to 6 previous errors
62
63For more information about this error, try `rustc --explain E0382`.