2013-06-20 14:11:47 -05:00
|
|
|
struct S(~str);
|
|
|
|
impl Drop for S {
|
2013-11-01 20:06:31 -05:00
|
|
|
fn drop(&mut self) { }
|
2013-06-20 14:11:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_match() {
|
|
|
|
match S(~"foo") {
|
|
|
|
S(_s) => {}
|
|
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_let() {
|
|
|
|
let S(_s) = S(~"foo");
|
|
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_in_fn_arg(S(_s): S) {
|
|
|
|
//~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|