]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.fixed
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-move-out-of-tuple-struct-with-dtor.fixed
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(ref _s) => {}
12     }
13 }
14
15 fn move_in_let() {
16     let S(ref _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(ref _s): S) {
21     //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait
22 }
23
24 fn main() {}