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