Skip to content

Commit 8152164

Browse files
committed
Another test for #2587
1 parent 0ce88fe commit 8152164

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/test/compile-fail/issue-2587-2.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
fn foo<T: copy>(+_t: T) { fail; }
2+
3+
fn bar<T>(+_t: T) { fail; }
4+
5+
struct S {
6+
x: int;
7+
drop {}
8+
}
9+
10+
fn S(x: int) -> S { S { x: x } }
11+
12+
impl S: Add<S, S> {
13+
pure fn add(rhs: S) -> S {
14+
S { x: self.x + rhs.x }
15+
}
16+
}
17+
18+
fn main() {
19+
let v = S(5);
20+
let _y = v + (move v); //~ ERROR: copying a noncopyable value
21+
}

0 commit comments

Comments
 (0)