summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/semistatement-in-lambda.rs
blob: ebd55e0ba02f1f9cee0f50beead312c825ec84a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass

#![allow(unused_must_use)]

pub fn main() {
    // Test that lambdas behave as unary expressions with block-like expressions
    -if true { 1 } else { 2 } * 3;
    || if true { 1 } else { 2 } * 3;

    // The following is invalid and parses as `if true { 1 } else { 2 }; *3`
    // if true { 1 } else { 2 } * 3
}