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