]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized-locals/borrow-after-move.stderr
Rollup merge of #73630 - estebank:fn-item-e0308, r=davidtwco
[rust.git] / src / test / ui / unsized-locals / borrow-after-move.stderr
1 error[E0382]: borrow of moved value: `x`
2   --> $DIR/borrow-after-move.rs:20:24
3    |
4 LL |         let y = *x;
5    |                 -- value moved here
6 LL |         drop_unsized(y);
7 LL |         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
12 error[E0382]: borrow of moved value: `y`
13   --> $DIR/borrow-after-move.rs:22:24
14    |
15 LL |         let y = *x;
16    |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
17 LL |         drop_unsized(y);
18    |                      - value moved here
19 ...
20 LL |         println!("{}", &y);
21    |                        ^^ value borrowed here after move
22
23 error[E0382]: borrow of moved value: `x`
24   --> $DIR/borrow-after-move.rs:30:24
25    |
26 LL |         let y = *x;
27    |                 -- value moved here
28 LL |         y.foo();
29 LL |         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
34 error[E0382]: borrow of moved value: `y`
35   --> $DIR/borrow-after-move.rs:32:24
36    |
37 LL |         let y = *x;
38    |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
39 LL |         y.foo();
40    |         - value moved here
41 ...
42 LL |         println!("{}", &y);
43    |                        ^^ value borrowed here after move
44
45 error[E0382]: borrow of moved value: `x`
46   --> $DIR/borrow-after-move.rs:39:24
47    |
48 LL |         let x = "hello".to_owned().into_boxed_str();
49    |             - move occurs because `x` has type `std::boxed::Box<str>`, which does not implement the `Copy` trait
50 LL |         x.foo();
51    |         - value moved here
52 LL |         println!("{}", &x);
53    |                        ^^ value borrowed here after move
54
55 error: aborting due to 5 previous errors
56
57 For more information about this error, try `rustc --explain E0382`.