Skip to content

Require braces when a closure has an explicit return type. #23475

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

Merged
merged 1 commit into from
Mar 19, 2015

Conversation

nikomatsakis
Copy link
Contributor

Require braces when a closure has an explicit return type. This is a [breaking-change]: instead of a closure like || -> i32 22, prefer || -> i32 { 22 }.

Fixes #23420.

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+ d72a7d5

@nikomatsakis
Copy link
Contributor Author

@bors r-

@nikomatsakis
Copy link
Contributor Author

I see local compilation failures. I'll have a fully fixed branch shortly.

@nikomatsakis
Copy link
Contributor Author

@bors r+ 1115087

[breaking-change]: instead of a closure like `|| -> i32 22`, prefer `||
-> i32 { 22 }`.

Fixes rust-lang#23420.
@nikomatsakis
Copy link
Contributor Author

@bors r=acrichto c225824

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 19, 2015
…acrichto

 Require braces when a closure has an explicit return type. This is a [breaking-change]: instead of a closure like `|| -> i32 22`, prefer `|| -> i32 { 22 }`.

Fixes rust-lang#23420.
@bors bors merged commit c225824 into rust-lang:master Mar 19, 2015
@barosl
Copy link
Contributor

barosl commented Mar 19, 2015

This change is fascinating! It is also amusing that the changed code didn't use the explicit braces previously. 😄

@nikomatsakis nikomatsakis deleted the closure-ret-syntax branch March 30, 2016 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement tweak to closure grammar
5 participants