]> git.lizzy.rs Git - rust.git/blob - src/test/ui/newlambdas.rs
Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtree
[rust.git] / src / test / ui / newlambdas.rs
1 // run-pass
2 // Tests for the new |args| expr lambda syntax
3
4
5 fn f<F>(i: isize, f: F) -> isize where F: FnOnce(isize) -> isize { f(i) }
6
7 fn g<G>(_g: G) where G: FnOnce() { }
8
9 pub fn main() {
10     assert_eq!(f(10, |a| a), 10);
11     g(||());
12     assert_eq!(f(10, |a| a), 10);
13     g(||{});
14 }