]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-rvalue.nll.stderr
Regression test for issue #54477.
[rust.git] / src / test / ui / dst / dst-rvalue.nll.stderr
1 error[E0161]: cannot move a value of type str: the size of str cannot be statically determined
2   --> $DIR/dst-rvalue.rs:16:28
3    |
4 LL |     let _x: Box<str> = box *"hello world";
5    |                            ^^^^^^^^^^^^^^
6
7 error[E0161]: cannot move a value of type [isize]: the size of [isize] cannot be statically determined
8   --> $DIR/dst-rvalue.rs:21:32
9    |
10 LL |     let _x: Box<[isize]> = box *array;
11    |                                ^^^^^^
12
13 error[E0507]: cannot move out of borrowed content
14   --> $DIR/dst-rvalue.rs:16:28
15    |
16 LL |     let _x: Box<str> = box *"hello world";
17    |                            ^^^^^^^^^^^^^^ cannot move out of borrowed content
18
19 error[E0507]: cannot move out of data in a `&` reference
20   --> $DIR/dst-rvalue.rs:16:28
21    |
22 LL |     let _x: Box<str> = box *"hello world";
23    |                            ^^^^^^^^^^^^^^
24    |                            |
25    |                            cannot move out of data in a `&` reference
26    |                            cannot move
27
28 error[E0508]: cannot move out of type `[isize]`, a non-copy slice
29   --> $DIR/dst-rvalue.rs:21:32
30    |
31 LL |     let _x: Box<[isize]> = box *array;
32    |                                ^^^^^^ cannot move out of here
33
34 error[E0507]: cannot move out of `*array` which is behind a `&` reference
35   --> $DIR/dst-rvalue.rs:21:32
36    |
37 LL |     let array: &[isize] = &[1, 2, 3];
38    |                           ---------- help: consider changing this to be a mutable reference: `&mut [1, 2, 3]`
39 LL |     let _x: Box<[isize]> = box *array;
40    |                                ^^^^^^
41    |                                |
42    |                                cannot move out of `*array` which is behind a `&` reference
43    |                                `array` is a `&` reference, so the data it refers to cannot be moved
44
45 error: aborting due to 6 previous errors
46
47 Some errors occurred: E0161, E0507, E0508.
48 For more information about an error, try `rustc --explain E0161`.