Uh oh!
There was an error while loading. Please reload this page.
Don't call drop when taking the address of unsized fields - #25595
Merged
Conversation
rust-highfive
commented
May 19, 2015
Contributor
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
bluss
commented
May 19, 2015
Contributor
This should fix #25515 too? And the use of the |
eddyb
commented
May 19, 2015
Contributor
LGTM, but the test could use also checking another arbitrary trait, I believe @bluss is correct here. |
pnkfelix
commented
May 19, 2015
Contributor
When taking the address of an unsized field we generate a rvalue datum for the field and then convert it to an lvalue datum. At that point, cleanup is scheduled for the field, leading to multiple drop calls. The problem is that we generate an rvalue datum for the field, since the pointer does not own the data and there's already cleanup scheduled elsewhere by the true owner. Instead, an lvalue datum must be created. Thanks to @eddyb for identifying the underlying cause and suggesting the correct fix. Fixesrust-lang#25549Fixesrust-lang#25515
dotdash
commented
May 19, 2015
ContributorAuthor
@bors r=eddyb |
bors
commented
May 19, 2015
Collaborator
📌 Commit b802b18 has been approved by |
bors added a commit
that referenced
this pull request
May 20, 2015
When taking the address of an unsized field we generate a rvalue datum for the field and then convert it to an lvalue datum. At that point, cleanup is scheduled for the field, leading to multiple drop calls. The problem is that we generate an rvalue datum for the field, since the pointer does not own the data and there's already cleanup scheduled elsewhere by the true owner. Instead, an lvalue datum must be created. Thanks to @eddyb for identifying the underlying cause and suggesting the correct fix. Fixes#25549.
bors
commented
May 20, 2015
Collaborator
bors
commented
May 20, 2015
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When taking the address of an unsized field we generate a rvalue datum
for the field and then convert it to an lvalue datum. At that point,
cleanup is scheduled for the field, leading to multiple drop calls.
The problem is that we generate an rvalue datum for the field, since the
pointer does not own the data and there's already cleanup scheduled
elsewhere by the true owner. Instead, an lvalue datum must be created.
Thanks to @eddyb for identifying the underlying cause and suggesting the
correct fix.
Fixes#25549.