-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
It seems that you need to add parentheses in order to put a catch
expression in a match head, but if you do, you get a warning:
#![feature(catch_expr)]
fn main() {
match (do catch { }) { } //~WARN unnecessary parentheses around `match` head expression
match do catch { } { } //~ERROR expected expression, found reserved keyword `do`
}
Why are the parens required anyway?
euclio, whoisj, kennytm, shepmaster, Thiez and 3 more
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.F-try_blocks`#![feature(try_blocks)]``#![feature(try_blocks)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.