-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Stabilize may_dangle using borrowck #3390
Conversation
Syntax is still bound to be bikeshedded but we think this looks pretty good.
Will it somehow interact with "move references" (unique references that drop, but not deallocate a value) or moveit? |
@vi yes. hopefully without being a problem, tho. |
For this change to be backwards compatible, the compiler needs to be able to infer that any normal I also wonder whether it's appropriate to use |
eh, with and as far as we can tell the |
Right the concrete type does always satisfy it, but in a generic context the compiler can't use reasoning like that, because it can't exhaustively test every type, it has to prove one set of bounds ( |
nod tho we'd rather not have to add multiple new |
had this RFC, or well rust-lang/types-team#85, in my notifications for a while and am finally taking some time to look at this. While I can't speak for the rest of t-types my current vibe is:
while I haven't been involved in the recent discussions about dropck rules I am very happy that someone is actually trying to untangle that mess ❤️ I think this RFC should be either postponed or closed. Even if we have the necessary capacity in the future, I don't feel like this is worth the added complexity. In my experience |
we hear that. at the same time, the main motivation for trying to push this forward isn't what it'd bring to rustc/std developers have shot themselves in the foot with |
Rendered
This is more or less as it says, the goal is to stabilize may_dangle, sorta.
This RFC effectively turns dropck problems into borrowck problems. There are many analogs of dropck problems in the borrowck world, including but not limited to lifetime specialization. We think this is pretty neat. This is also roughly similar to the "Parametricity via some ?-Bound" approach discussed in the original UGEH RFC: https://rust-lang.github.io/rfcs/1238-nonparametric-dropck.html#parametricity-via-some--bound , tho we wouldn't call this RFC actually parametric (tho we're not entirely sure what "parametric" means tbh).
Previous PR: #3331
Current Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/deprecating.20spooky-dropck-at-a-distance
Also, acknowledgements: Thanks to the folks who encouraged us to make this a thing. It was kind of an accident (we were trying to explain the idea to folks, and then it kinda... happened). We hope this is okay.