-
Notifications
You must be signed in to change notification settings - Fork 293
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
Add blog post to introduce disjoint capture in closures #884
Conversation
|
||
The precise path that gets captured is typically the full path that is used in the closure, but there are cases where we will only capture a prefix of the path. See this pending PR to the [Rust Reference](https://github.com/rust-lang/reference/blob/d24c4642c8efd26915209558e065a5e670363fc0/src/types/closure.md) for the full details. | ||
|
||
The feature also includes (minor) breaking changes to the Rust semantics which are also documented in this pending PR to the [Rust Reference](https://github.com/rust-lang/reference/blob/d24c4642c8efd26915209558e065a5e670363fc0/src/types/closure.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe link to the PR rust-lang/reference#1059 instead of a commit, since this commit was force pushed over AFAICT.
Co-authored-by: Caleb Cartwright <[email protected]> Co-authored-by: Eric Huss <[email protected]>
|
||
## How to submit bugs? | ||
|
||
To submit a bug simply [open an issue](https://github.com/rust-lang/rust/issues/new/choose) and tag the RFC 2229 working group using `@rust-lang/wg-rfc-2229`. We hope to create the best experince posible so no issue is too small, even a confusing error messages is worth reporting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most folks won't be able to tag the working group (you need to be part of the org to ping teams). I think the easiest is to just ask folks to leave a label via rustbot, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we ask users to create issue directly on the 2229 repo? https://github.com/rust-lang/project-rfc-2229. MIght be a bit easier than trying to use rustbot
@nikomatsakis what are your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm! I think I'd prefer to have people file bugs on rust-lang/rust. I'm not sure what's the best way for people to tag disjoint closures though.
Co-authored-by: Jennifer Wills <[email protected]>
Should this post be on the main blog, or on Inside Rust? Generally speaking, the way we've treated things historically is that the main blog is aimed at every user of Rust, and Inside Rust is for folks interested in Rust development, similar to other venues, like the users forum vs internals forum. Given that this is asking people to test a currently nightly feature, this feels more like an Inside Rust thing to me personally. I don't feel intensely strongly that this is so, and there is some degree of flexibility; for example, the recent post on GATs is something that is really super major, and while this change is certainly a really great one, I'm not sure it rises to the same level of "we must tell everyone who uses Rust about this specific development." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This post is great overall, I have one tiny nit.
author: The RFC 2229 working group <https://www.rust-lang.org/governance/teams/compiler#wg-rfc-2229> | ||
--- | ||
|
||
One of the major features of the [upcoming Rust 2021 Edition](https://blog.rust-lang.org/2021/05/11/edition-2021.html)) is a change to how Rust closures work. This change makes closure captures more precise, eliminating common borrow check errors. As a result, it involves some (minor) changes to Rust semantics, which is why it is tied to the Rust 2021 edition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this should be a relative link
|
||
## How to use the feature? | ||
|
||
Interested in testing this out? You can now try disjoint capture in Rust closures on rust nightly using `#![feature(capture_disjoint_fields)]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These instructions may be out-of-date now, or at least confusing. #![feature(capture_disjoint_fields)]
shows a giant warning that the feature is incomplete and may not be safe to use. However, it is now stable in 2021 which seems like a conflicting message to me.
Also, there is only a few weeks left until this hits stable. Might be worth noting that this will be stable on October 21st.
We discussed this some in Zulip. It seems to me that this is an exciting feature that is coming up in Rust 2021, so the post seems like a good way to get people excited about the upcoming release. It may want to be reframed somewhat to make that clearer, though. i.e., you don't have to use an unstable, nightly feature to get access, you just have to use Rust 2021 on the beta branch =) That said, it is debatable whether it's better to post this before or after the Edition release is finalized. Maybe it would be nice to come somewhat after the release. In other words: I think the proper audience for this post is all Rust users, not Rust developers. |
@roxelo @nikomatsakis given that the edition has come and gone, is this still worth releasing. Should we perhaps close this instead? |
Closing makes sense to me
…On Wed, Jun 22, 2022 at 4:43 AM Ryan Levick ***@***.***> wrote:
@roxelo <https://github.com/roxelo> @nikomatsakis
<https://github.com/nikomatsakis> given that the edition has come and
gone, is this still worth releasing. Should we perhaps close this instead?
—
Reply to this email directly, view it on GitHub
<#884 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA77WCZMHUA5EFLVX7BN65TVQL347ANCNFSM5BPYFALA>
.
You are receiving this because you are on a team that was mentioned.Message
ID: ***@***.***>
|
Closing this as out of date |
This PR adds a blog post to introduce disjoint capture in closures and encourage user testing.
cc @rust-lang/wg-rfc-2229
r? @nikomatsakis