rust/tests/pretty/disamb-stmt-expr.rs

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

11 lines
299 B
Rust
Raw Normal View History

// pp-exact
// Here we check that the parentheses around the body of `wsucc()` are
2012-08-01 19:30:05 -05:00
// 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 }
2021-12-01 13:45:14 -06:00
fn main() {}