Skip to content

Add RFC PR and tracking issue links to RFC 1558 #2630

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
Jan 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions text/1558-closure-to-fn-coercion.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- Feature Name: closure_to_fn_coercion
- Start Date: 2016-03-25
- RFC PR: (leave this empty)
- Rust Issue: (leave this empty)
- RFC PR: [rust-lang/rfcs#1558](https://github.com/rust-lang/rfcs/pull/1558)
- Rust Issue: [rust-lang/rust#39817](https://github.com/rust-lang/rust/issues/39817)

# Summary
[summary]: #summary
Expand Down Expand Up @@ -153,13 +153,13 @@ and by circumstance later need to capture a variable. The required change from `
be a breaking change.

We do expect crate authors to measure their API's flexibility in other areas, however, as when
determining whether to take `&self` or `&mut self`. Taking a similar situation to the above:
determining whether to take `&self` or `&mut self`. Taking a similar situation to the above:

```rust
fn func_specific<'a>(&'a self) -> impl Fn() -> u32 {
move || return self.field
}

fn func_general<'a>(&'a mut self) -> impl FnMut() -> u32 {
move || { self.field += 1; return self.field; }
}
Expand Down