2019-07-26 16:54:25 -05:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 05:20:28 -05:00
|
|
|
#![allow(non_snake_case)]
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn asBlock<F>(f: F) -> usize where F: FnOnce() -> usize {
|
2012-08-01 19:30:05 -05:00
|
|
|
return f();
|
2011-12-29 22:07:55 -06:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2015-03-03 02:42:26 -06:00
|
|
|
let x = asBlock(|| 22);
|
|
|
|
assert_eq!(x, 22);
|
2011-12-29 22:07:55 -06:00
|
|
|
}
|