2011-11-18 05:39:20 -06:00
|
|
|
// error-pattern: copying a noncopyable value
|
2011-09-27 16:28:20 -05:00
|
|
|
|
2012-03-26 20:35:18 -05:00
|
|
|
resource r(i: @mut int) {
|
2011-09-27 16:28:20 -05:00
|
|
|
*i = *i + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-03-26 20:35:18 -05:00
|
|
|
let i = @mut 0;
|
2011-09-27 16:28:20 -05:00
|
|
|
{
|
|
|
|
// Can't do this copy
|
|
|
|
let x = ~~~{y: r(i)};
|
|
|
|
let z = x;
|
2011-12-22 19:53:53 -06:00
|
|
|
log(debug, x);
|
2011-09-27 16:28:20 -05:00
|
|
|
}
|
2011-12-22 19:53:53 -06:00
|
|
|
log(error, *i);
|
2011-09-27 16:28:20 -05:00
|
|
|
}
|