]> git.lizzy.rs Git - rust.git/blob - src/test/ui/semistatement-in-lambda.rs
Auto merge of #81507 - weiznich:add_diesel_to_cargo_test, r=Mark-Simulacrum
[rust.git] / src / test / ui / 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 }