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

AtomicOption is not pointer sized #7271

Closed
brson opened this issue Jun 21, 2013 · 1 comment
Closed

AtomicOption is not pointer sized #7271

brson opened this issue Jun 21, 2013 · 1 comment

Comments

@brson
Copy link
Contributor

brson commented Jun 21, 2013

AtomicOption is an atomic, nullable unique pointer, but because it has a dtor it does not have pointer size:

rust: ~"size_of::<AtomicOption<()>>(): 16"
rust: ~"size_of::<uint>(): 8"

It would be very convenient if this type was freely castable to pointer-size types.

@thestinger
Copy link
Contributor

I have #7138 open about potentially adding an attribute to omit the drop flag by zeroing the struct instead and just calling the destructor multiple times - letting the Drop implementation deal with it. Seems like it would be usable for this too.

@bors bors closed this as completed in d161e63 Jun 25, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 10, 2023
…n, r=flip1995

Add machine applicable suggestion for `needless_lifetimes`

changelog: [`needless_lifetimes`]: Add machine applicable suggestion

Fixes rust-lang#9360

It doesn't make suggestions for async functions as the input lifetime spans are funky there

The examples in rust-lang#5787 and rust-lang#7271 no longer seem to FP this PR aside, I added tests for them rather than disabling the lint entirely for async functions, I don't know if there are further FPs there though

Closes rust-lang#5787
Closes rust-lang#7271
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 a pull request may close this issue.

2 participants