summary refs log tree commit diff
path: root/src/test/compile-fail/record-with-resource.rs
blob: 6cdaafb22a5747bb76a40993322c0be64c3204aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// error-pattern: copying a noncopyable value

resource my_resource(x: int) {
    log(error, x);
}

fn main() {
    {
        let a = {x: 0, y: my_resource(20)};
        let b = {x: 2 with a};
        log(error, (a, b));
    }
}