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

Document T must be sized and why #28

Merged
merged 1 commit into from
Apr 12, 2020
Merged

Document T must be sized and why #28

merged 1 commit into from
Apr 12, 2020

Conversation

vorner
Copy link
Owner

@vorner vorner commented Apr 12, 2020

Closes #27.

@shepmaster, do you want to have a look?

Copy link

@shepmaster shepmaster left a comment

Choose a reason for hiding this comment

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

Just some minor things

//!
//! // But this does:
//! let data: ArcSwap<Box<[u8]>> = ArcSwap::from_pointee(Box::new([1, 2, 3]));
//! # drop(data);

Choose a reason for hiding this comment

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

Why the explicit drop?

Copy link
Owner Author

Choose a reason for hiding this comment

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

To avoid an unused variable warning. I turn warning into errors in code examples, to avoid unidiomatic code being left in when the coding standards change over time. It's hidden line, though.

src/lib.rs Outdated
//! # Limitations
//!
//! This currently works only for `Sized` types. Unsized types have „fat pointers“, which are twice
//! as large as the normal ones. The [AtomicPtr] doesn't support them. One could use something like

Choose a reason for hiding this comment

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

Could use code syntax for AtomicPtr.

@vorner vorner merged commit 79acd3f into master Apr 12, 2020
@vorner vorner deleted the sized branch April 12, 2020 15:50
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.

Mention that unsized types are not supported, maybe explain why
2 participants