]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr
15c7011d71671c90b0852f028ce47060a1102c0d
[rust.git] / src / test / ui / borrowck / borrowck-move-out-of-struct-with-dtor.mir.stderr
1 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
2   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:20:11
3    |
4 LL |     match (S {f:"foo".to_string()}) {
5    |           ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
6 LL |         //[mir]~^ ERROR [E0509]
7 LL |         S {f:_s} => {}
8    |              --
9    |              |
10    |              data moved here
11    |              help: to prevent move, use ref or ref mut: `ref _s`
12
13 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
14   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:20
15    |
16 LL |     let S {f:_s} = S {f:"foo".to_string()};
17    |              --    ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
18    |              |
19    |              data moved here
20    |              help: to prevent move, use ref or ref mut: `ref _s`
21
22 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
23   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:19
24    |
25 LL | fn move_in_fn_arg(S {f:_s}: S) {
26    |                   ^^^^^--^
27    |                   |    |
28    |                   |    data moved here
29    |                   |    help: to prevent move, use ref or ref mut: `ref _s`
30    |                   cannot move out of here
31
32 error: aborting due to 3 previous errors
33
34 For more information about this error, try `rustc --explain E0509`.