Skip to content
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

Fix an ICE when implementing Drop on enums #14793

Closed
wants to merge 1 commit into from
Closed

Fix an ICE when implementing Drop on enums #14793

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 10, 2014

Fixes #13041.

@alexcrichton
Copy link
Member

Could you add a test to ensure that this doesn't leak memory?

enum Foo { NoDrop, NeedsDrop(Box<int>) }
impl Drop for Foo {
    fn drop(&mut self) {
        *self = NeedsDrop(box 3);
    }
}

@ghost
Copy link
Author

ghost commented Jun 10, 2014

@alexcrichton Good call, this needs more work. :-) What was I thinking? Will reopen.

@ghost ghost closed this Jun 10, 2014
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't ICE when implementing Drop on enums
1 participant