-
Notifications
You must be signed in to change notification settings - Fork 13.3k
RFC: Can we make drop glue for recursive types not stack overflow? #8399
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
Comments
This can be avoided by hand with the following destructor:
|
Unfortunately we can't even rely on tail-call optimization in some cases, for example, a tree where each stack frame has to recurse once on each branch. I wonder if the above hand-coded destructor can be generalized. Nominating well-covered. |
Previous issue (solved) for DList in particular #8295 |
Oh yeah thanks for the link. I suppose I should tag this an RFC to see if we can solve it in the general case. |
At least with optimizations enabled this would already be a non-issue in many cases if we weren't making so many possibly invalid casts. |
With optimizations disabled we should have well-defined behaviour too :P |
The behaviour would still be well-defined, it would just use a lot more memory than necessary. That's really no different than how we use a ridiculous amount of stack space everywhere else without optimizations. |
It occurred to me on the way in this morning that this would be very hard if not impossible to do for tree-like types, |
@bblum: yeah, there are cases where you fundamentally require a stack of some sort - luckily, for self-balancing binary search trees the depth is |
Just a bug (this may never get fixed) |
Triage: no change. (I updated the example.) |
Triage:
Running:
|
I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized. This issue has been moved to the RFCs repo: rust-lang/rfcs#686 |
Example 2014-02-23
Original example
The text was updated successfully, but these errors were encountered: