summaryrefslogtreecommitdiffstats
path: root/src/test/pretty/disamb-stmt-expr.rs
blob: 734f9fa123eea2c420947d12f3c162b92f7aa5a4 (plain)
1
2
3
4
5
6
7
8
9
10
// pp-exact

// Here we check that the parentheses around the body of `wsucc()` are
// preserved.  They are needed to disambiguate `{return n+1}; - 0` from
// `({return n+1}-0)`.

fn id<F>(f: F) -> isize where F: Fn() -> isize { f() }

fn wsucc(_n: isize) -> isize { id(|| { 1 }) - 0 }
fn main() {}