]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0509]: cannot move out of type `S`, which implements the `Drop` trait |
48663c56 | 2 | --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:7:11 |
b7449926 XL |
3 | | |
4 | LL | match (S {f:"foo".to_string()}) { | |
5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here | |
532ac7d7 | 6 | LL | |
b7449926 | 7 | LL | S {f:_s} => {} |
dc9dc135 XL |
8 | | -- |
9 | | | | |
10 | | data moved here | |
1b1a35ee | 11 | | move occurs because `_s` has type `String`, which does not implement the `Copy` trait |
b7449926 XL |
12 | |
13 | error[E0509]: cannot move out of type `S`, which implements the `Drop` trait | |
48663c56 | 14 | --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:14:20 |
b7449926 XL |
15 | | |
16 | LL | let S {f:_s} = S {f:"foo".to_string()}; | |
17 | | -- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here | |
18 | | | | |
19 | | data moved here | |
1b1a35ee | 20 | | move occurs because `_s` has type `String`, which does not implement the `Copy` trait |
b7449926 XL |
21 | |
22 | error[E0509]: cannot move out of type `S`, which implements the `Drop` trait | |
48663c56 | 23 | --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:18:19 |
b7449926 XL |
24 | | |
25 | LL | fn move_in_fn_arg(S {f:_s}: S) { | |
26 | | ^^^^^--^ | |
27 | | | | | |
28 | | | data moved here | |
1b1a35ee | 29 | | | move occurs because `_s` has type `String`, which does not implement the `Copy` trait |
b7449926 | 30 | | cannot move out of here |
b7449926 XL |
31 | |
32 | error: aborting due to 3 previous errors | |
33 | ||
34 | For more information about this error, try `rustc --explain E0509`. |