2012-08-28 17:54:45 -05:00
|
|
|
// xfail-test #3387
|
|
|
|
|
|
|
|
enum foo = ~uint;
|
|
|
|
|
2012-09-19 20:00:26 -05:00
|
|
|
impl foo : Add<foo, foo> {
|
|
|
|
pure fn add(f: &foo) -> foo {
|
|
|
|
foo(~(**self + **(*f)))
|
|
|
|
}
|
|
|
|
}
|
2012-08-28 17:54:45 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = foo(~3);
|
|
|
|
let _y = x + move x;
|
|
|
|
//~^ ERROR moving out of immutable local variable prohibited due to outstanding loan
|
|
|
|
}
|