-
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
Segfault when casting owned structs to owned traits (double free?) #6318
Comments
I've been looking at this one as I originally discovered it. I've been looking in the wrong place though... it is not just sum-types, but any cast of a unique struct to a unique trait. This also segfaults:
It segfaults on a glue_drop function in both examples. I'm not too certain about the invariants of the takes and drops. I'm assuming they are done in mirror. Is it dropping something twice by mistake? |
Good catch, I've updated the title. |
This no longer segfaults; needs a testcase. |
(well, testcases arleady exist, just need their way into the suite) |
@cmr yay! that's awesome. :) I'll try and pull the fixed code and try it out with my original breaking code later today. |
Awesome. All of the cases I came up with all compile and run as expected. Thanks. :) |
…shearth Use article_and_description for missing docs Moves closer to the current rustc missing_doc lint changelog: none
This compiles, but segfaults when run:
The segfault goes away when you do the following:
A(a) => 0
toA(_) => 0
A(~Foo)
toA(~Struct)
(and remove the cast)The text was updated successfully, but these errors were encountered: