Another test for #2587

This commit is contained in:
Tim Chevalier 2012-09-06 16:46:41 -07:00
parent 0ce88fe401
commit 8152164a34

View file

@ -0,0 +1,21 @@
fn foo<T: copy>(+_t: T) { fail; }
fn bar<T>(+_t: T) { fail; }
struct S {
x: int;
drop {}
}
fn S(x: int) -> S { S { x: x } }
impl S: Add<S, S> {
pure fn add(rhs: S) -> S {
S { x: self.x + rhs.x }
}
}
fn main() {
let v = S(5);
let _y = v + (move v); //~ ERROR: copying a noncopyable value
}