-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Closure reform #2202
Comments
@nikomatsakis Should this be an RFC, since it would change syntax? |
I don't feel it's necessary as I think it is more like a tweak. More importantly, I don't think that the work on regions makes much sense without taking these steps. |
But I am happy to prepare an RFC if you think it makes sense. |
Well, by the RFC process criteria, it is a change to the AST that isn't just refactoring, doesn't relate to numerical criteria, and would be noticed by end users. But if you think that would be overkill, it's your call. |
OK. FWIW I don't think it'd be noticed by end-users: that is, all existing syntax will remain valid, it'll just be re-interpreted to be regions-based. |
I'm confused -- you said in the original post that " |
You're right, what I wrote was misleading (or perhaps just plain wrong). I meant that it would go away in the type system. You'd still be able to type |
Ah ok. Then I agree, not really visible to users, hence no need for an RFC. |
Moved to 0.4. |
@catamorphism I think the beginning work here has been done. The remaining work is probably better left to 0.5. Is there some specific change you had in mind for 0.4? |
That is true. I am not sure that we need to fix that for 0.4 though. |
Fixes rust-lang#1896 which was never truly fixed, just masked. The given tests would have failed had they used `~fn()` and not `@fn()`. They now result in compilation errors. Fixes rust-lang#2978. Necessary first step for rust-lang#2202, rust-lang#2263.
A possible test:
|
Not critical for 0.6; removing milestone |
What remains to be done:
|
Oh, I forgot to add the biggest instance of work yet to be done. Making them sound! See this blog post for details: http://smallcultfollowing.com/babysteps/blog/2013/04/30/the-case-of-the-recurring-closure/ This is blocked on #6298. |
Repurposing this issue as a metabug. |
nominating backwards compat |
accepted for backwards-compatible milestone |
1 similar comment
accepted for backwards-compatible milestone |
visiting for triage. nothing to add. |
Update: I have a branch that does a lot of the borowck work. Semi-blocked on fixing destructor semantics. |
Current plan of action:
|
cc me |
As part of this work, we need to update the kinds for function types to take into account the mutability etc of the captured values. |
Updated main comment. |
updated the description to add #13621 |
I propose closing this as an outdated metabug that is currently not particularly actionable. We have several other bugs for unboxed closures. |
Closing in favor of new unboxed closures approach we are now adopting: see rust-lang/rfcs#114 |
…xes, r=RalfJung Fix rustdoc warnings This fixes the rustdoc warnings presented by the tool
Users can now select a subset of harnesses to run using `--harness` multiple times. Previously users could either run a single harness or they had to run them all. For the example provided in rust-lang#1778: ```rust // example.rs #[kani::proof] fn a() {} #[kani::proof] fn b() {} #[kani::proof] fn c() {std::unimplemented!();} ``` Users can select harnesses `a` and `b` by running: ```bash $ kani example.rs --harness a --harness b ``` In case of multiple matches, Kani will run all harnesses that matches at least one of the `--harness` argument.
UPDATE:
This is a meta-bug now for tracking the work on completing closures. Now that #6801 has landed, the remaining pieces of work are:
'a ||
as syntaxORIGINAL FOLLOWS:
We need to revamp function types in light of regions. I think
fn()
(the "any" function) will go away, andfn@()
andfn~()
will be coercable tofn&()
, just as with poiners/vectors/slices/etc. Also,fn&()
becomesfn&r()
(that is, r is a region), though the user won't typically need to write it. We can probably leave the representation as is, though we could also tweakfn&()
to not have a ref count since there will be an explicit borrowing that occurs.The text was updated successfully, but these errors were encountered: