Add generic-temporary.rs minimal test showing cause of lib-deque.rs failure on stage0.
This commit is contained in:
parent
2c65e10a9f
commit
0910a7323c
21
src/test/run-pass/generic-temporary.rs
Normal file
21
src/test/run-pass/generic-temporary.rs
Normal file
@ -0,0 +1,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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user