fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0507]: cannot move out of `*a` which is behind a shared reference 2 --> $DIR/move-errors.rs:6:13 3 | 4LL | let b = *a; 5 | ^^ move occurs because `*a` has type `A`, which does not implement the `Copy` trait 6 | 7help: consider removing the dereference here 8 | 9LL - let b = *a; 10LL + let b = a; 11 | 12 13error[E0508]: cannot move out of type `[A; 1]`, a non-copy array 14 --> $DIR/move-errors.rs:12:13 15 | 16LL | let b = a[0]; 17 | ^^^^ 18 | | 19 | cannot move out of here 20 | move occurs because `a[_]` has type `A`, which does not implement the `Copy` trait 21 | 22help: consider borrowing here 23 | 24LL | let b = &a[0]; 25 | + 26 27error[E0507]: cannot move out of `**r` which is behind a shared reference 28 --> $DIR/move-errors.rs:19:13 29 | 30LL | let s = **r; 31 | ^^^ move occurs because `**r` has type `A`, which does not implement the `Copy` trait 32 | 33help: consider removing the dereference here 34 | 35LL - let s = **r; 36LL + let s = *r; 37 | 38 39error[E0507]: cannot move out of an `Rc` 40 --> $DIR/move-errors.rs:27:13 41 | 42LL | let s = *r; 43 | ^^ move occurs because value has type `A`, which does not implement the `Copy` trait 44 | 45help: consider removing the dereference here 46 | 47LL - let s = *r; 48LL + let s = r; 49 | 50 51error[E0508]: cannot move out of type `[A; 1]`, a non-copy array 52 --> $DIR/move-errors.rs:32:13 53 | 54LL | let a = [A("".to_string())][0]; 55 | ^^^^^^^^^^^^^^^^^^^^^^ 56 | | 57 | cannot move out of here 58 | move occurs because value has type `A`, which does not implement the `Copy` trait 59 | 60help: consider borrowing here 61 | 62LL | let a = &[A("".to_string())][0]; 63 | + 64 65error[E0507]: cannot move out of `a` which is behind a shared reference 66 --> $DIR/move-errors.rs:38:16 67 | 68LL | let A(s) = *a; 69 | - ^^ 70 | | 71 | data moved here 72 | move occurs because `s` has type `String`, which does not implement the `Copy` trait 73 | 74help: consider removing the dereference here 75 | 76LL - let A(s) = *a; 77LL + let A(s) = a; 78 | 79 80error[E0509]: cannot move out of type `D`, which implements the `Drop` trait 81 --> $DIR/move-errors.rs:44:19 82 | 83LL | let C(D(s)) = c; 84 | - ^ cannot move out of here 85 | | 86 | data moved here 87 | move occurs because `s` has type `String`, which does not implement the `Copy` trait 88 | 89help: consider borrowing the pattern binding 90 | 91LL | let C(D(ref s)) = c; 92 | +++ 93 94error[E0507]: cannot move out of `*a` which is behind a shared reference 95 --> $DIR/move-errors.rs:51:9 96 | 97LL | b = *a; 98 | ^^ move occurs because `*a` has type `A`, which does not implement the `Copy` trait 99 100error[E0508]: cannot move out of type `[B; 1]`, a non-copy array 101 --> $DIR/move-errors.rs:74:11 102 | 103LL | match x[0] { 104 | ^^^^ cannot move out of here 105LL | 106LL | B::U(d) => (), 107 | - data moved here 108LL | B::V(s) => (), 109 | - ...and here 110 | 111 = note: move occurs because these variables have types that don't implement the `Copy` trait 112help: consider borrowing here 113 | 114LL | match &x[0] { 115 | + 116 117error[E0509]: cannot move out of type `D`, which implements the `Drop` trait 118 --> $DIR/move-errors.rs:83:11 119 | 120LL | match x { 121 | ^ cannot move out of here 122... 123LL | B::U(D(s)) => (), 124 | - 125 | | 126 | data moved here 127 | move occurs because `s` has type `String`, which does not implement the `Copy` trait 128 | 129help: consider borrowing the pattern binding 130 | 131LL | B::U(D(ref s)) => (), 132 | +++ 133 134error[E0509]: cannot move out of type `D`, which implements the `Drop` trait 135 --> $DIR/move-errors.rs:92:11 136 | 137LL | match x { 138 | ^ cannot move out of here 139... 140LL | (D(s), &t) => (), 141 | - 142 | | 143 | data moved here 144 | move occurs because `s` has type `String`, which does not implement the `Copy` trait 145 | 146help: consider borrowing the pattern binding 147 | 148LL | (D(ref s), &t) => (), 149 | +++ 150 151error[E0507]: cannot move out of `*x.1` which is behind a shared reference 152 --> $DIR/move-errors.rs:92:11 153 | 154LL | match x { 155 | ^ 156... 157LL | (D(s), &t) => (), 158 | - 159 | | 160 | data moved here 161 | move occurs because `t` has type `String`, which does not implement the `Copy` trait 162 | 163help: consider borrowing the pattern binding 164 | 165LL | (D(s), &ref t) => (), 166 | +++ 167 168error[E0509]: cannot move out of type `F`, which implements the `Drop` trait 169 --> $DIR/move-errors.rs:102:11 170 | 171LL | match x { 172 | ^ cannot move out of here 173LL | 174LL | F(s, mut t) => (), 175 | - ----- ...and here 176 | | 177 | data moved here 178 | 179 = note: move occurs because these variables have types that don't implement the `Copy` trait 180help: consider borrowing the pattern binding 181 | 182LL | F(ref s, mut t) => (), 183 | +++ 184help: consider borrowing the pattern binding 185 | 186LL | F(s, ref mut t) => (), 187 | +++ 188 189error[E0507]: cannot move out of `x` as enum variant `Err` which is behind a shared reference 190 --> $DIR/move-errors.rs:110:11 191 | 192LL | match *x { 193 | ^^ 194LL | 195LL | Ok(s) | Err(s) => (), 196 | - 197 | | 198 | data moved here 199 | move occurs because `s` has type `String`, which does not implement the `Copy` trait 200 | 201help: consider removing the dereference here 202 | 203LL - match *x { 204LL + match x { 205 | 206 207error: aborting due to 14 previous errors 208 209Some errors have detailed explanations: E0507, E0508, E0509. 210For more information about an error, try `rustc --explain E0507`.