Another test for #2587
This commit is contained in:
parent
0ce88fe401
commit
8152164a34
1 changed files with 21 additions and 0 deletions
21
src/test/compile-fail/issue-2587-2.rs
Normal file
21
src/test/compile-fail/issue-2587-2.rs
Normal 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
|
||||
}
|
Loading…
Reference in a new issue