rust/tests/ui/last-use-in-block.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
429 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
#![allow(unused_parens)]
// Issue #1818
2015-01-02 22:32:54 +00:00
fn lp<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {
while false {
let r = f(s);
2013-02-15 10:44:18 +00:00
return (r);
}
panic!();
}
2015-01-02 22:32:54 +00:00
fn apply<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {
fn g<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {f(s)}
2013-02-15 10:44:18 +00:00
g(s, |v| { let r = f(v); r })
}
pub fn main() {}