]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
Rollup merge of #102281 - RalfJung:invalid-enums, r=cjgillot
[rust.git] / src / test / ui / borrowck / borrowck-move-out-of-tuple-struct-with-dtor.rs
1 struct S(String);
2 impl Drop for S {
3     fn drop(&mut self) { }
4 }
5
6 fn move_in_match() {
7     match S("foo".to_string()) {
8         //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
9         S(_s) => {}
10     }
11 }
12
13 fn move_in_let() {
14     let S(_s) = S("foo".to_string());
15     //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
16 }
17
18 fn move_in_fn_arg(S(_s): S) {
19     //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
20 }
21
22 fn main() {}