-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Obsolete the closure kind syntax #21843
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
🎯 |
r=me, nice work! For posterity, the offending FIXMEs were all inserted in this commit: 2c91b5e9199b5b8631a74ac3d50359df54d745b7 |
Regarding the FIXMEs, those were known -- that is, there is still a bit of remaining work as described in #21805. |
Should I change the FIXMEs to point to the issue for @nikomatsakis's follow-up work (is there one?), or should I remove them? |
Updated |
|&:| {}
-> || {}
⌛ Testing commit 92f11e9 with merge 8b55fa7... |
💔 Test failed - auto-linux-64-opt |
@bors: retry (can't reproduce failure locally) |
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)
…eklabnik Based off rust-lang#21843, it looks like the syntax in the Closures guide is outdated.
Based off rust-lang#21843, it looks like the syntax in the Closures guide is outdated.
This is leftover from rust-lang#21843 If you still have `|&:| {}` closures in your code, simply remove the `&:` part. [breaking-change]
Obsoletes the closure kind syntax (the
&:
,&mut:
:
in|&:| {}
) as the compiler will now infer the rightFn*
trait from the context.To fix your code simply remove the
&:
annotations, and let the compiler do the magic.[breaking-change]