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 unsoundness in MappedMutexGuard #2240

Merged
merged 1 commit into from
Oct 23, 2020
Merged

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Oct 23, 2020

Fix Send/Sync impls and add PhantomData<&'a mut U> to tell the compiler that the guard is own a &mut U.

This is technically a breaking change, but the code failed to compile by this change is unsound, so this breakage should be acceptable.

Fixes #2239

@taiki-e taiki-e merged commit cfb827a into rust-lang:master Oct 23, 2020
@taiki-e taiki-e deleted the mutex-map branch October 23, 2020 17:13
@taiki-e taiki-e mentioned this pull request Oct 23, 2020
@taiki-e taiki-e added the A-lock Area: futures::lock label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lock Area: futures::lock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MappedMutexGuard Send/Sync bound is unsound
2 participants