fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
1.9 KiB57 linesraw
1error[E0382]: borrow of moved value: `x`
2  --> $DIR/borrow-after-move.rs:20:24
3   |
4LL |         let y = *x;
5   |                 -- value moved here
6LL |         drop_unsized(y);
7LL |         println!("{}", &x);
8   |                        ^^ value borrowed here after partial move
9   |
10   = note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
11
12error[E0382]: borrow of moved value: `y`
13  --> $DIR/borrow-after-move.rs:22:24
14   |
15LL |         let y = *x;
16   |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
17LL |         drop_unsized(y);
18   |                      - value moved here
19...
20LL |         println!("{}", &y);
21   |                        ^^ value borrowed here after move
22
23error[E0382]: borrow of moved value: `x`
24  --> $DIR/borrow-after-move.rs:30:24
25   |
26LL |         let y = *x;
27   |                 -- value moved here
28LL |         y.foo();
29LL |         println!("{}", &x);
30   |                        ^^ value borrowed here after partial move
31   |
32   = note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
33
34error[E0382]: borrow of moved value: `y`
35  --> $DIR/borrow-after-move.rs:32:24
36   |
37LL |         let y = *x;
38   |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
39LL |         y.foo();
40   |         - value moved here
41...
42LL |         println!("{}", &y);
43   |                        ^^ value borrowed here after move
44
45error[E0382]: borrow of moved value: `x`
46  --> $DIR/borrow-after-move.rs:39:24
47   |
48LL |         x.foo();
49   |         - value moved here
50LL |         println!("{}", &x);
51   |                        ^^ value borrowed here after partial move
52   |
53   = note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
54
55error: aborting due to 5 previous errors
56
57For more information about this error, try `rustc --explain E0382`.