Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect "unnecessary parentheses" warning for match (return) #55164

Closed
varkor opened this issue Oct 17, 2018 · 0 comments
Closed

Incorrect "unnecessary parentheses" warning for match (return) #55164

varkor opened this issue Oct 17, 2018 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@varkor
Copy link
Member

varkor commented Oct 17, 2018

#![allow(unreachable_code)]

fn main() {
	match (return) {} // warning: unnecessary parentheses around `match` head expression
}

Removing the parentheses results in a syntax error.

@varkor varkor added the A-diagnostics Area: Messages for errors, warnings, and lints label Oct 17, 2018
kennytm added a commit to kennytm/rust that referenced this issue Oct 18, 2018
Don't warn about parentheses on `match (return)`

Fixes rust-lang#55164.
kennytm added a commit to kennytm/rust that referenced this issue Oct 19, 2018
Don't warn about parentheses on `match (return)`

Fixes rust-lang#55164.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

1 participant