blob: 460e2ce23fc9f0a65f1a5fe6db055b913a0ca19e [file] [log] [blame]
enum E {
Foo,
Bar(~str)
}
struct S {
x: E
}
fn f(x: ~str) {}
fn main() {
let s = S { x: Bar(~"hello") };
match &s.x {
&Foo => {}
&Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move
};
match &s.x {
&Foo => {}
&Bar(ref identifier) => println(*identifier)
};
}