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 a reference count bug in libsync arc #13211

Merged
merged 1 commit into from Mar 31, 2014
Merged

Fix a reference count bug in libsync arc #13211

merged 1 commit into from Mar 31, 2014

Conversation

ghost
Copy link

@ghost ghost commented Mar 30, 2014

This is a fix for #13210. fetch_sub returns the old value of the atomic variable, not the new one.

@alexcrichton
Copy link
Member

Can you add a test about making sure the destructor has run? Additionally, could you put the Closes #XXXX into the commit message as well as the pull request?

Thanks for finding this!

@ghost
Copy link
Author

ghost commented Mar 30, 2014

I added a test to see if child data of the Arc has been freed. I'm not sure there is a way to insure that the Weak references are freeing their pointer outside of a tool like valgrind.

@alexcrichton
Copy link
Member

Can you squash the two commits together? Logically they're part of the same unit.

@ghost
Copy link
Author

ghost commented Mar 30, 2014

Sure, done.

bors added a commit that referenced this pull request Mar 30, 2014
This is a fix for #13210. fetch_sub returns the old value of the atomic variable, not the new one.
@bors bors closed this Mar 31, 2014
@bors bors merged commit 9fc45c1 into rust-lang:master Mar 31, 2014
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 24, 2024
…ct_constructor_on_adt, r=Alexendoo

Respect allow `inconsistent_struct_constructor` on the struct definition

Closes rust-lang#13203

Now we check if the target type is marked with `#[allow(clippy:inconsistent_struct_constructor)]` before lining.
As a side-effect of this change, The rule in the subject no longer runs on non-local `AdtDef`s. However, as suggested by `@Jarcho` it shouldn't be a big deal since most of the time we didn't have access to this information anyway.

> You can't get lint attributes from other crates. I would probably just restrict the lint to only work with types from the current crate while you're at it. Upstream crates don't have a definition order from the point of view of the current crate (with the exception of #[repr(C)] structs).

changelog: Respect allow `inconsistent_struct_constructor` on the struct definition.
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.

3 participants