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
300 B
Rust
Raw Normal View History

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