2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 10:20:28 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_parens)]
|
2012-02-13 13:47:36 +00:00
|
|
|
// Issue #1818
|
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2015-01-02 22:32:54 +00:00
|
|
|
fn lp<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {
|
2012-02-13 13:47:36 +00:00
|
|
|
while false {
|
|
|
|
let r = f(s);
|
2013-02-15 10:44:18 +00:00
|
|
|
return (r);
|
2012-02-13 13:47:36 +00:00
|
|
|
}
|
2014-10-09 19:17:22 +00:00
|
|
|
panic!();
|
2012-02-13 13:47:36 +00:00
|
|
|
}
|
|
|
|
|
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 })
|
2012-02-13 13:47:36 +00:00
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {}
|