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

Vec: remove the drop flag to make it no larger than (*T, uint, uint). #12845

Merged
merged 1 commit into from
Mar 13, 2014

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Mar 12, 2014

No description provided.

free(self.ptr as *mut c_void)
free(self.ptr as *mut c_void);

// Prevent further drop calls from having any effect.
Copy link
Member

Choose a reason for hiding this comment

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

would you mind adding a test for this scenario? I just want to make sure that if someone mucks with things and messes up the logic here that we'll have a prayer of catching it in our test suite.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not how unsafe_no_drop_flag works. It will cause the destructor to be run multiple times on different addresses due to moves. It causes a move to zero the entire value, so the check needs to be at the start of the destructor.

@eddyb
Copy link
Member Author

eddyb commented Mar 12, 2014

@alexcrichton I hope I didn't interfere with the roll-up by force pushing.

@bors bors closed this Mar 13, 2014
@bors bors merged commit 500bade into rust-lang:master Mar 13, 2014
@eddyb eddyb deleted the vec-no-drop-flag branch March 15, 2014 17:54
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 13, 2024
…archo

Dedup nonminimal_bool_methods diags

Relates to rust-lang#12379

Fix `nonminimal_bool` lint so that it doesn't check the same span multiple times.

`NotSimplificationVisitor` was called for each expression from `NonminimalBoolVisitor` whereas `NotSimplificationVisitor` also recursively checked all expressions.

---

changelog: [`nonminimal_bool`]: Fix duplicate diagnostics
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