ba3eebd41d
an explicit variable name. (Step one to changing the defaults) First step to #3535
18 lines
355 B
Rust
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);
|
|
}
|