aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/generic-temporary.rs
blob: 0df8c36ee1ff5ac9de426df357e247de0735b6f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// xfail-stage0

fn mk() -> int {
  ret 1;
}

fn chk(&int a) {
  log a;
  check (a == 1);
}

fn apply[T](fn() -> T produce, fn(&T) consume) {
  consume(produce());
}

fn main() {
  let (fn()->int) produce = mk;
  let (fn(&int)) consume = chk;
  apply[int](produce, consume);
}