summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/old-closure-arg-call-as.rs
blob: 87cf3a487bf433a635dd59f6503e37623cf596cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass

#![allow(non_snake_case)]

fn asBlock<F>(f: F) -> usize where F: FnOnce() -> usize {
   return f();
}

pub fn main() {
   let x = asBlock(|| 22);
   assert_eq!(x, 22);
}