summaryrefslogtreecommitdiffstats
path: root/tests/ui/newlambdas.rs
blob: 90de53856c0d8830ca847a102121afd57db131c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass
// Tests for the new |args| expr lambda syntax


fn f<F>(i: isize, f: F) -> isize where F: FnOnce(isize) -> isize { f(i) }

fn g<G>(_g: G) where G: FnOnce() { }

pub fn main() {
    assert_eq!(f(10, |a| a), 10);
    g(||());
    assert_eq!(f(10, |a| a), 10);
    g(||{});
}