Fix #1458 (allow paren'd exprs to be the operator in a `do`)
Closes #1458
This commit is contained in:
parent
165ce14f68
commit
4e5865f2ad
|
@ -1576,7 +1576,7 @@ impl Parser {
|
|||
@{node: expr_call(f, args, true),
|
||||
.. *e}
|
||||
}
|
||||
expr_path(*) | expr_field(*) | expr_call(*) => {
|
||||
expr_path(*) | expr_field(*) | expr_call(*) | expr_paren(*) => {
|
||||
let block = self.parse_lambda_block_expr();
|
||||
let last_arg = self.mk_expr(block.span.lo, block.span.hi,
|
||||
ctor(block));
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
fn plus_one(f: fn() -> int) -> int {
|
||||
return f() + 1;
|
||||
}
|
||||
|
||||
fn ret_plus_one() -> fn(fn() -> int) -> int {
|
||||
return plus_one;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let z = do (ret_plus_one()) || { 2 };
|
||||
assert z == 3;
|
||||
}
|
Loading…
Reference in New Issue