]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.stderr
Auto merge of #60039 - rasendubi:assert-trailing-junk, r=alexcrichton
[rust.git] / src / test / ui / borrowck / borrowck-move-out-of-struct-with-dtor.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:7:11
3    |
4 LL |     match (S {f:"foo".to_string()}) {
5    |           ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
6 LL |
7 LL |         S {f:_s} => {}
8    |              -- data moved here
9    |
10 note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
11   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:9:14
12    |
13 LL |         S {f:_s} => {}
14    |              ^^
15
16 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
17   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:14:20
18    |
19 LL |     let S {f:_s} = S {f:"foo".to_string()};
20    |              --    ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
21    |              |
22    |              data moved here
23    |
24 note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
25   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:14:14
26    |
27 LL |     let S {f:_s} = S {f:"foo".to_string()};
28    |              ^^
29
30 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
31   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:18:19
32    |
33 LL | fn move_in_fn_arg(S {f:_s}: S) {
34    |                   ^^^^^--^
35    |                   |    |
36    |                   |    data moved here
37    |                   cannot move out of here
38    |
39 note: move occurs because `_s` has type `std::string::String`, which does not implement the `Copy` trait
40   --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:18:24
41    |
42 LL | fn move_in_fn_arg(S {f:_s}: S) {
43    |                        ^^
44
45 error: aborting due to 3 previous errors
46
47 For more information about this error, try `rustc --explain E0509`.