summary refs log tree commit diff
path: root/src/test/compile-fail/tstate-fru.rs
blob: c5335ce1f8567e317a61e09197fe52a0694d6505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// -*- rust -*-

type point = {x: int, y: int};

pure fn test(_p: point) -> bool { true }
fn tested(p: point) : test(p) -> point { p }

fn main() {
    let origin: point;
    origin = {x: 0, y: 0};
    let right: point = {x: 10 with tested(origin)};
        //~^ ERROR precondition
    copy right;
}