]> git.lizzy.rs Git - rust.git/blob - tests/pretty/unary-op-disambig.rs
Rollup merge of #106661 - mjguzik:linux_statx, r=Mark-Simulacrum
[rust.git] / tests / pretty / unary-op-disambig.rs
1 // compile-flags: --crate-type=lib
2
3 // Preserve semicolons that disambiguate unops
4
5 fn f() { }
6
7 fn block_semi() -> isize { { f() }; -1 }
8
9 fn block_nosemi() -> isize { ({ 0 }) - 1 }
10
11 fn if_semi() -> isize { if true { f() } else { f() }; -1 }
12
13 fn if_nosemi() -> isize { (if true { 0 } else { 0 }) - 1 }
14
15 fn alt_semi() -> isize { match true { true => { f() } _ => { } }; -1 }
16
17 fn alt_no_semi() -> isize { (match true { true => { 0 } _ => { 1 } }) - 1 }
18
19 fn stmt() { { f() }; -1; }