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

Unsound trait implementation in UnsafeRef #92

Closed
cblichmann opened this issue Aug 20, 2024 · 0 comments · Fixed by #93
Closed

Unsound trait implementation in UnsafeRef #92

cblichmann opened this issue Aug 20, 2024 · 0 comments · Fixed by #93

Comments

@cblichmann
Copy link
Contributor

This came up in an internal unsafe review:

In src/unsafe_ref.rs:107

unsafe impl<T: ?Sized + Send> Send for UnsafeRef<T> {}

Unsafe Rust review: this is unsound -- UnsafeRef<T> should only implement Send if T is Send + Sync (what Arc does), since sending one instance to another thread would allow it to be referenced from two different threads.

cblichmann added a commit to cblichmann/intrusive-rs that referenced this issue Aug 21, 2024
Fixes Amanieu#92. This applies a suggestion from @cramertj in an internal
unsafe review.
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.

1 participant