fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.1 KiB118 linesraw
1error[E0507]: cannot move out of `*r` which is behind a shared reference
2  --> $DIR/cannot-move-block-spans.rs:5:15
3   |
4LL |     let x = { *r };
5   |               ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
6   |
7help: consider removing the dereference here
8   |
9LL -     let x = { *r };
10LL +     let x = { r };
11   |
12
13error[E0507]: cannot move out of `*r` which is behind a shared reference
14  --> $DIR/cannot-move-block-spans.rs:6:22
15   |
16LL |     let y = unsafe { *r };
17   |                      ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
18   |
19help: consider removing the dereference here
20   |
21LL -     let y = unsafe { *r };
22LL +     let y = unsafe { r };
23   |
24
25error[E0507]: cannot move out of `*r` which is behind a shared reference
26  --> $DIR/cannot-move-block-spans.rs:7:26
27   |
28LL |     let z = loop { break *r; };
29   |                          ^^ move occurs because `*r` has type `String`, which does not implement the `Copy` trait
30   |
31help: consider removing the dereference here
32   |
33LL -     let z = loop { break *r; };
34LL +     let z = loop { break r; };
35   |
36
37error[E0508]: cannot move out of type `[String; 2]`, a non-copy array
38  --> $DIR/cannot-move-block-spans.rs:11:15
39   |
40LL |     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   |
46help: consider borrowing here
47   |
48LL |     let x = { &arr[0] };
49   |               +
50
51error[E0508]: cannot move out of type `[String; 2]`, a non-copy array
52  --> $DIR/cannot-move-block-spans.rs:12:22
53   |
54LL |     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   |
60help: consider borrowing here
61   |
62LL |     let y = unsafe { &arr[0] };
63   |                      +
64
65error[E0508]: cannot move out of type `[String; 2]`, a non-copy array
66  --> $DIR/cannot-move-block-spans.rs:13:26
67   |
68LL |     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   |
74help: consider borrowing here
75   |
76LL |     let z = loop { break &arr[0]; };
77   |                          +
78
79error[E0507]: cannot move out of `*r` which is behind a shared reference
80  --> $DIR/cannot-move-block-spans.rs:17:38
81   |
82LL |     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   |
85help: consider removing the dereference here
86   |
87LL -     let x = { let mut u = 0; u += 1; *r };
88LL +     let x = { let mut u = 0; u += 1; r };
89   |
90
91error[E0507]: cannot move out of `*r` which is behind a shared reference
92  --> $DIR/cannot-move-block-spans.rs:18:45
93   |
94LL |     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   |
97help: consider removing the dereference here
98   |
99LL -     let y = unsafe { let mut u = 0; u += 1; *r };
100LL +     let y = unsafe { let mut u = 0; u += 1; r };
101   |
102
103error[E0507]: cannot move out of `*r` which is behind a shared reference
104  --> $DIR/cannot-move-block-spans.rs:19:49
105   |
106LL |     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   |
109help: consider removing the dereference here
110   |
111LL -     let z = loop { let mut u = 0; u += 1; break *r; u += 2; };
112LL +     let z = loop { let mut u = 0; u += 1; break r; u += 2; };
113   |
114
115error: aborting due to 9 previous errors
116
117Some errors have detailed explanations: E0507, E0508.
118For more information about an error, try `rustc --explain E0507`.