]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.stderr
Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov
[rust.git] / tests / ui / borrowck / borrowck-move-out-of-tuple-struct-with-dtor.stderr
1 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
2   --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:9:11
3    |
4 LL |     match S("foo".to_string()) {
5    |           ^^^^^^^^^^^^^^^^^^^^ cannot move out of here
6 LL |
7 LL |         S(_s) => {}
8    |           --
9    |           |
10    |           data moved here
11    |           move occurs because `_s` has type `String`, which does not implement the `Copy` trait
12    |
13 help: consider borrowing the pattern binding
14    |
15 LL |         S(ref _s) => {}
16    |           +++
17
18 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
19   --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:16:17
20    |
21 LL |     let S(_s) = S("foo".to_string());
22    |           --    ^^^^^^^^^^^^^^^^^^^^ cannot move out of here
23    |           |
24    |           data moved here
25    |           move occurs because `_s` has type `String`, which does not implement the `Copy` trait
26    |
27 help: consider borrowing the pattern binding
28    |
29 LL |     let S(ref _s) = S("foo".to_string());
30    |           +++
31
32 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
33   --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:20:19
34    |
35 LL | fn move_in_fn_arg(S(_s): S) {
36    |                   ^^--^
37    |                   | |
38    |                   | data moved here
39    |                   | move occurs because `_s` has type `String`, which does not implement the `Copy` trait
40    |                   cannot move out of here
41    |
42 help: consider borrowing the pattern binding
43    |
44 LL | fn move_in_fn_arg(S(ref _s): S) {
45    |                     +++
46
47 error: aborting due to 3 previous errors
48
49 For more information about this error, try `rustc --explain E0509`.