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