graydon/rust — Issue #1458: pp omits parens needed to disambiguate call-with-block sugar
Author: jruderman
Created: 2012-01-08 04:30:57+00:00
State: open
Labels: pretty

This is a passing Rust program:

fn plus_one(f: block() -> int) -> int {
ret f() + 1;
}

fn ret_plus_one() -> fn(block() -> int) -> int {
ret plus_one;
}

fn main() {
let z = (ret_plus_one()) {|| 2};
assert z == 3;
}

The pretty-printer omits the parens around the call in main, so the result of pretty-printing does not compile.