]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-move-out-of-struct-with-dtor.fixed
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-move-out-of-struct-with-dtor.fixed
1 // run-rustfix
2 #![allow(unused)]
3 struct S {f:String}
4 impl Drop for S {
5     fn drop(&mut self) { println!("{}", self.f); }
6 }
7
8 fn move_in_match() {
9     match (S {f:"foo".to_string()}) {
10         //~^ ERROR [E0509]
11         S {f:ref _s} => {}
12     }
13 }
14
15 fn move_in_let() {
16     let S {f:ref _s} = S {f:"foo".to_string()};
17     //~^ ERROR [E0509]
18 }
19
20 fn move_in_fn_arg(S {f:ref _s}: S) {
21     //~^ ERROR [E0509]
22 }
23
24 fn main() {}