2011-11-18 12:39:20 +01:00
|
|
|
// error-pattern: copying a noncopyable value
|
2011-09-27 14:28:20 -07:00
|
|
|
|
|
|
|
resource r(i: @mutable int) {
|
|
|
|
*i = *i + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let i = @mutable 0;
|
|
|
|
{
|
|
|
|
// Can't do this copy
|
|
|
|
let x = ~~~{y: r(i)};
|
|
|
|
let z = x;
|
2011-12-22 14:42:52 -08:00
|
|
|
log_full(core::debug, x);
|
2011-09-27 14:28:20 -07:00
|
|
|
}
|
2011-12-22 14:42:52 -08:00
|
|
|
log_full(core::error, *i);
|
2011-09-27 14:28:20 -07:00
|
|
|
}
|