Skip to content

Adding unsafe Send trait implementation for RingBuf #20326

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

Merged
merged 1 commit into from
Dec 31, 2014
Merged

Adding unsafe Send trait implementation for RingBuf #20326

merged 1 commit into from
Dec 31, 2014

Conversation

rohitjoshi
Copy link
Contributor

fixes #20322

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@@ -49,6 +49,9 @@ pub struct RingBuf<T> {
}

#[stable]
unsafe impl<T: Send> Send for RingBuf<T> {
Copy link
Member

Choose a reason for hiding this comment

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

The convention is to have the whole impl on the same line, including the last }.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, new commit has impl in same line for both Send and Sync.

@huonw
Copy link
Member

huonw commented Dec 30, 2014

Thanks!

Could you also add the same sort of implementation for Sync?

@rohitjoshi
Copy link
Contributor Author

Added support for Sync as well.

@huonw
Copy link
Member

huonw commented Dec 30, 2014

Looks good! Could you squash the two commits?

@alexcrichton
Copy link
Member

(just for the future) we may also want to try to use Unique wherever possible to avoid manual unsafe implementations.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 31, 2014
@bors bors merged commit 8fb25ab into rust-lang:master Dec 31, 2014
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 15, 2015
When I submitted a PR rust-lang#20326, mistakenly was committed using my work email. Correct the email address.

NOTE: Steve klabnik has updated  email address  in http://blog.rust-lang.org/2015/01/09/Rust-1.0-alpha.html
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.

Send Trait for RingBuf
6 participants