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