2011-11-18 05:39:20 -06:00
|
|
|
// error-pattern: copying a noncopyable value
|
2011-09-27 16:24:18 -05:00
|
|
|
|
|
|
|
resource r(i: @mutable int) {
|
|
|
|
*i = *i + 1;
|
|
|
|
}
|
|
|
|
|
2011-11-18 05:39:20 -06:00
|
|
|
fn f<T>(+i: [T], +j: [T]) {
|
2011-09-27 16:24:18 -05:00
|
|
|
let k = i + j;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let i1 = @mutable 0;
|
|
|
|
let i2 = @mutable 1;
|
|
|
|
let r1 <- [~r(i1)];
|
|
|
|
let r2 <- [~r(i2)];
|
|
|
|
f(r1, r2);
|
2011-12-22 16:42:52 -06:00
|
|
|
log_full(core::debug, (r2, *i1));
|
|
|
|
log_full(core::debug, (r1, *i2));
|
2011-09-27 16:24:18 -05:00
|
|
|
}
|