Skip to content

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