- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-bugCategory: This is a bug.Category: This is a bug.F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`
Description
Simple demo that won't compile but should be a type error:
#![feature(try_blocks)] fn demo() { return try { 4 }; }
But it gives a parse error instead:
error: expected one of `.`, `;`, `?`, `}`, or an operator, found reserved keyword `try` --> src/lib.rs:3:12 | 3 | return try { 4 }; | ^^^ expected one of `.`, `;`, `?`, `}`, or an operator error: aborting due to previous error
(It works if you put parens, like return (try { 4 });
)
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-bugCategory: This is a bug.Category: This is a bug.F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`