summary refs log tree commit diff
path: root/src/test/run-pass/regions-params.rs
blob: 0a378235682842ff8b24482fb719f7e531055edd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn region_identity(x: &r.uint) -> &r.uint { x }

fn apply<T>(t: T, f: fn(T) -> T) -> T { f(t) }

fn parameterized(x: &uint) -> uint {
    let z = apply(x, ({|y|
        region_identity(y)
    }));
    *z
}

fn main() {
    let x = 3u;
    assert parameterized(&x) == 3u;
}