]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/cannot-move-block-spans.stderr
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / cannot-move-block-spans.stderr
1 error[E0507]: cannot move out of `*r` which is behind a shared reference
2   --> $DIR/cannot-move-block-spans.rs:5:15
3    |
4 LL |     let x = { *r };
5    |               ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
6    |
7 help: consider removing the dereference here
8    |
9 LL -     let x = { *r };
10 LL +     let x = { r };
11    |
12
13 error[E0507]: cannot move out of `*r` which is behind a shared reference
14   --> $DIR/cannot-move-block-spans.rs:6:22
15    |
16 LL |     let y = unsafe { *r };
17    |                      ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
18    |
19 help: consider removing the dereference here
20    |
21 LL -     let y = unsafe { *r };
22 LL +     let y = unsafe { r };
23    |
24
25 error[E0507]: cannot move out of `*r` which is behind a shared reference
26   --> $DIR/cannot-move-block-spans.rs:7:26
27    |
28 LL |     let z = loop { break *r; };
29    |                          ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
30    |
31 help: consider removing the dereference here
32    |
33 LL -     let z = loop { break *r; };
34 LL +     let z = loop { break r; };
35    |
36
37 error[E0508]: cannot move out of type `[String; 2]`, a non-copy array
38   --> $DIR/cannot-move-block-spans.rs:11:15
39    |
40 LL |     let x = { arr[0] };
41    |               ^^^^^^
42    |               |
43    |               cannot move out of here
44    |               move occurs because `arr[_]` has type `String`, which does not implement the `Copy` trait
45    |
46 help: consider borrowing here
47    |
48 LL |     let x = { &arr[0] };
49    |               +
50
51 error[E0508]: cannot move out of type `[String; 2]`, a non-copy array
52   --> $DIR/cannot-move-block-spans.rs:12:22
53    |
54 LL |     let y = unsafe { arr[0] };
55    |                      ^^^^^^
56    |                      |
57    |                      cannot move out of here
58    |                      move occurs because `arr[_]` has type `String`, which does not implement the `Copy` trait
59    |
60 help: consider borrowing here
61    |
62 LL |     let y = unsafe { &arr[0] };
63    |                      +
64
65 error[E0508]: cannot move out of type `[String; 2]`, a non-copy array
66   --> $DIR/cannot-move-block-spans.rs:13:26
67    |
68 LL |     let z = loop { break arr[0]; };
69    |                          ^^^^^^
70    |                          |
71    |                          cannot move out of here
72    |                          move occurs because `arr[_]` has type `String`, which does not implement the `Copy` trait
73    |
74 help: consider borrowing here
75    |
76 LL |     let z = loop { break &arr[0]; };
77    |                          +
78
79 error[E0507]: cannot move out of `*r` which is behind a shared reference
80   --> $DIR/cannot-move-block-spans.rs:17:38
81    |
82 LL |     let x = { let mut u = 0; u += 1; *r };
83    |                                      ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
84    |
85 help: consider removing the dereference here
86    |
87 LL -     let x = { let mut u = 0; u += 1; *r };
88 LL +     let x = { let mut u = 0; u += 1; r };
89    |
90
91 error[E0507]: cannot move out of `*r` which is behind a shared reference
92   --> $DIR/cannot-move-block-spans.rs:18:45
93    |
94 LL |     let y = unsafe { let mut u = 0; u += 1; *r };
95    |                                             ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
96    |
97 help: consider removing the dereference here
98    |
99 LL -     let y = unsafe { let mut u = 0; u += 1; *r };
100 LL +     let y = unsafe { let mut u = 0; u += 1; r };
101    |
102
103 error[E0507]: cannot move out of `*r` which is behind a shared reference
104   --> $DIR/cannot-move-block-spans.rs:19:49
105    |
106 LL |     let z = loop { let mut u = 0; u += 1; break *r; u += 2; };
107    |                                                 ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
108    |
109 help: consider removing the dereference here
110    |
111 LL -     let z = loop { let mut u = 0; u += 1; break *r; u += 2; };
112 LL +     let z = loop { let mut u = 0; u += 1; break r; u += 2; };
113    |
114
115 error: aborting due to 9 previous errors
116
117 Some errors have detailed explanations: E0507, E0508.
118 For more information about an error, try `rustc --explain E0507`.