rust/src/test/run-pass/generic-temporary.rs
Niko Matsakis ba3eebd41d Make it illegal to use modes in a fn signature with providing
an explicit variable name. (Step one to changing the defaults)

First step to #3535
2012-09-23 13:30:13 -05:00

18 lines
355 B
Rust

// xfail-fast
#[legacy_modes];
fn mk() -> int { return 1; }
fn chk(&&a: int) { log(debug, a); assert (a == 1); }
fn apply<T>(produce: extern fn() -> T,
consume: extern fn(T)) {
consume(produce());
}
fn main() {
let produce: extern fn() -> int = mk;
let consume: extern fn(&&v: int) = chk;
apply::<int>(produce, consume);
}