]> git.lizzy.rs Git - rust.git/blob - src/test/ui/newlambdas.rs
Merge commit '05677b6bd6c938ed760835d9b1f6514992654ae3' into sync_cg_clif-2021-08-06
[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 }