]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/semistatement-in-lambda.rs
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
[rust.git] / tests / ui / closures / semistatement-in-lambda.rs
1 // run-pass
2
3 #![allow(unused_must_use)]
4
5 pub fn main() {
6     // Test that lambdas behave as unary expressions with block-like expressions
7     -if true { 1 } else { 2 } * 3;
8     || if true { 1 } else { 2 } * 3;
9
10     // The following is invalid and parses as `if true { 1 } else { 2 }; *3`
11     // if true { 1 } else { 2 } * 3
12 }