]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized-locals/double-move.stderr
Fix font color for help button in ayu and dark themes
[rust.git] / src / test / ui / unsized-locals / double-move.stderr
1 error[E0382]: use of moved value: `y`
2   --> $DIR/double-move.rs:20:22
3    |
4 LL |         let y = *x;
5    |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
6 LL |         drop_unsized(y);
7    |                      - value moved here
8 LL |         drop_unsized(y);
9    |                      ^ value used here after move
10
11 error[E0382]: use of moved value: `x`
12   --> $DIR/double-move.rs:26:22
13    |
14 LL |         let _y = *x;
15    |                  -- value moved here
16 LL |         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
21 error[E0382]: use of moved value: `*x`
22   --> $DIR/double-move.rs:32:18
23    |
24 LL |         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
26 LL |         drop_unsized(x);
27    |                      - value moved here
28 LL |         let _y = *x;
29    |                  ^^ value used here after move
30
31 error[E0382]: use of moved value: `y`
32   --> $DIR/double-move.rs:39:9
33    |
34 LL |         let y = *x;
35    |             - move occurs because `y` has type `str`, which does not implement the `Copy` trait
36 LL |         y.foo();
37    |           ----- `y` moved due to this method call
38 LL |         y.foo();
39    |         ^ value used here after move
40    |
41 note: this function consumes the receiver `self` by taking ownership of it, which moves `y`
42   --> $DIR/double-move.rs:4:12
43    |
44 LL |     fn foo(self) -> String;
45    |            ^^^^
46
47 error[E0382]: use of moved value: `x`
48   --> $DIR/double-move.rs:45:9
49    |
50 LL |         let _y = *x;
51    |                  -- value moved here
52 LL |         x.foo();
53    |         ^ value used here after partial move
54    |
55    = note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait
56
57 error[E0382]: use of moved value: `*x`
58   --> $DIR/double-move.rs:51:18
59    |
60 LL |         let x = "hello".to_owned().into_boxed_str();
61    |             - move occurs because `x` has type `std::boxed::Box<str>`, which does not implement the `Copy` trait
62 LL |         x.foo();
63    |         - value moved here
64 LL |         let _y = *x;
65    |                  ^^ value used here after move
66
67 error: aborting due to 6 previous errors
68
69 For more information about this error, try `rustc --explain E0382`.