2022-12-09 01:14:56 +00:00
|
|
|
//@ run-rustfix
|
|
|
|
#![allow(unused)]
|
2014-05-22 23:57:53 +00:00
|
|
|
struct S {f:String}
|
2013-06-20 19:11:47 +00:00
|
|
|
impl Drop for S {
|
2014-01-09 10:06:55 +00:00
|
|
|
fn drop(&mut self) { println!("{}", self.f); }
|
2013-06-20 19:11:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_match() {
|
2014-06-14 02:09:12 +00:00
|
|
|
match (S {f:"foo".to_string()}) {
|
2019-04-22 07:40:08 +00:00
|
|
|
//~^ ERROR [E0509]
|
2013-06-20 19:11:47 +00:00
|
|
|
S {f:_s} => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_let() {
|
2014-05-25 10:17:19 +00:00
|
|
|
let S {f:_s} = S {f:"foo".to_string()};
|
2019-04-22 07:40:08 +00:00
|
|
|
//~^ ERROR [E0509]
|
2013-06-20 19:11:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_fn_arg(S {f:_s}: S) {
|
2019-04-22 07:40:08 +00:00
|
|
|
//~^ ERROR [E0509]
|
2013-06-20 19:11:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|