rust/src/test/run-pass/last-use-in-block.rs

17 lines
283 B
Rust
Raw Normal View History

// Issue #1818
fn lp<T>(s: ~str, f: fn(~str) -> T) -> T {
while false {
let r = f(s);
2012-08-01 19:30:05 -05:00
return r;
}
fail;
}
fn apply<T>(s: ~str, f: fn(~str) -> T) -> T {
fn g<T>(s: ~str, f: fn(~str) -> T) -> T {f(s)}
2012-06-30 18:19:07 -05:00
g(s, |v| { let r = f(v); r })
}
fn main() {}