2013-06-20 14:11:47 -05:00
|
|
|
struct S {f:~str}
|
|
|
|
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() {
|
|
|
|
match S {f:~"foo"} {
|
|
|
|
S {f:_s} => {}
|
|
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_let() {
|
|
|
|
let S {f:_s} = S {f:~"foo"};
|
|
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_fn_arg(S {f:_s}: S) {
|
|
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|