Skip to content

pp omits parens needed to disambiguate call-with-block sugar #1458

Closed
@jruderman

Description

@jruderman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-prettyArea: Pretty printing (including `-Z unpretty`)E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions