Skip to content

Fix ICE caused by Drop implementations for unsized types #26759

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

Merged
merged 1 commit into from
Jul 3, 2015

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented Jul 3, 2015

Fixes #26709

@rust-highfive
Copy link
Contributor

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

struct Wrapper<T: ?Sized>(T);

impl<T: ?Sized> Drop for Wrapper<T> {
fn drop(&mut self) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that the destructor is really called correctly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dotdash yes, @arielb1 is right; in simple programs like this, it suffices to add a global counter and make sure it has the right values after each expected drop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went for a check that uses a pointer stored in the struct, to make sure that drop() is called with the right arguments.

@pnkfelix
Copy link
Member

pnkfelix commented Jul 3, 2015

r=me once the test is expanded as described above.

@dotdash
Copy link
Contributor Author

dotdash commented Jul 3, 2015

@bors r=pnkfelix

@bors
Copy link
Collaborator

bors commented Jul 3, 2015

📌 Commit eaeede2 has been approved by pnkfelix

@bors
Copy link
Collaborator

bors commented Jul 3, 2015

⌛ Testing commit eaeede2 with merge 320bd6f...

bors added a commit that referenced this pull request Jul 3, 2015
@bors bors merged commit eaeede2 into rust-lang:master Jul 3, 2015
@dotdash dotdash deleted the drop_dst branch July 27, 2015 08:49
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.

5 participants