-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Prevent regions from being closed over and hidden from view #2203
Comments
Shared or unique, same problem. I don't think this is a kinding problem, I think it's a region problem. You should not be able to write a region pointer into any region other than one of its own subregions. Forming a heap closure is such a write, and should be prohibited just as forming a heap record full of stack region pointers would be. |
A heap record is totally allowed. |
To clarify, it is legal to do this:
that poses no particular problem. I could see it being useful if you have a long-running computation with some context that is passed by region ptr, but the internal data used by the computation might be garbage-collected. Naturally all of those heap-allocated records will not be accessible after the computation finishes. |
Wow, I totally thought (and think) that should not be legal. We'll have to discuss once I'm at an irc window :) |
this is done for closures in commit 0e42004 |
related to #5723 |
I think that has been fixed by the work @bblum did on trait and closure bounds. Closing, re-open if I'm wrong. |
I didn't solve region-related issues; we still lack the capability to write |
Marked as clarifying - @nikomatsakis will investigate. |
Nominating because I believe this is fixed. |
@nikomatsakis still needs to investigate, he is not certain it is fixed, and if it isn't, it still is on plate for 1.0 |
Nominating. I believe this issue has been resolved with #16453 |
closing as fixed |
deprecate -Zmiri-allow-uninit-numbers and -Zmiri-allow-ptr-int-transmute Cc rust-lang/miri#2187 rust-lang/miri#2188
ci: Remove incorrect use of `continue-on-error`
Because a
&T
type is copyable, it is currently possible to close over them using anfn@()
(and, eventually,iface@
). This is clearly wrong. We need a new kind---perhapsheap
orgc
?---indicating data which is not only copyable but also copyable into a shared closure. This goes in between copy/send, I think.The text was updated successfully, but these errors were encountered: