rust/src/test/run-pass/semistatement-in-lambda.rs
2018-12-25 21:08:33 -07:00

11 lines
313 B
Rust

#![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
}