rust/src/test/compile-fail/record-with-resource.rs
2012-06-01 20:40:35 -07:00

16 lines
274 B
Rust

// error-pattern: copying a noncopyable value
class my_resource {
let x: int;
new(x: int) { self.x = x; }
drop { log(error, self.x); }
}
fn main() {
{
let a = {x: 0, y: my_resource(20)};
let b = {x: 2 with a};
log(error, (a, b));
}
}