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

Obsolete the closure kind syntax #21843

Merged
merged 2 commits into from
Feb 5, 2015
Merged

Obsolete the closure kind syntax #21843

merged 2 commits into from
Feb 5, 2015

Conversation

japaric
Copy link
Member

@japaric japaric commented Feb 1, 2015

Obsoletes the closure kind syntax (the &:, &mut: : in |&:| {}) as the compiler will now infer the right Fn* trait from the context.

To fix your code simply remove the &: annotations, and let the compiler do the magic.

[breaking-change]

@aturon
Copy link
Member

aturon commented Feb 1, 2015

🎯

@alexcrichton
Copy link
Member

r=me, nice work!

For posterity, the offending FIXMEs were all inserted in this commit: 2c91b5e9199b5b8631a74ac3d50359df54d745b7

@nikomatsakis
Copy link
Contributor

Regarding the FIXMEs, those were known -- that is, there is still a bit of remaining work as described in #21805.

@japaric
Copy link
Member Author

japaric commented Feb 1, 2015

Should I change the FIXMEs to point to the issue for @nikomatsakis's follow-up work (is there one?), or should I remove them?

@nikomatsakis
Copy link
Contributor

@japaric I think the issue is #16640 and it seems like it'd be good point at that.

@japaric
Copy link
Member Author

japaric commented Feb 2, 2015

Updated FIXMEs to point to #16640

@japaric
Copy link
Member Author

japaric commented Feb 5, 2015

@bors: r=alexcrichton 92f11e9

@japaric japaric changed the title cleanup: remove closure kind annotations |&:| {} -> || {} Obsolete the closure kind syntax Feb 5, 2015
@bors
Copy link
Contributor

bors commented Feb 5, 2015

⌛ Testing commit 92f11e9 with merge 8b55fa7...

@bors
Copy link
Contributor

bors commented Feb 5, 2015

💔 Test failed - auto-linux-64-opt

@japaric
Copy link
Member Author

japaric commented Feb 5, 2015

@bors: retry

(can't reproduce failure locally)

@bors
Copy link
Contributor

bors commented Feb 5, 2015

⌛ Testing commit 92f11e9 with merge 2c05354...

bors added a commit that referenced this pull request Feb 5, 2015
This needs a snapshot that includes #21805 before it can be merged.

There are some places where type inference regressed after I removed the annotations (see `FIXME`s). cc @nikomatsakis.

r? @eddyb or anyone
(I'll remove the `FIXME`s before merging, as they are only intended to point out regressions)
@bors bors merged commit 92f11e9 into rust-lang:master Feb 5, 2015
@japaric japaric deleted the kindless branch February 6, 2015 00:46
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 10, 2015
…eklabnik

Based off rust-lang#21843, it looks like the syntax in the Closures guide is outdated.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 10, 2015
Based off rust-lang#21843, it looks like the syntax in the Closures guide is outdated.
@japaric japaric mentioned this pull request Feb 28, 2015
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 28, 2015
 This is leftover from rust-lang#21843

If you still have `|&:| {}` closures in your code, simply remove the `&:` part.

[breaking-change]
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.

6 participants