rust/tests/ui/closures/semistatement-in-lambda.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
327 B
Rust
Raw Normal View History

//@ 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
}