diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-23 19:47:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-23 19:47:19 -0700 |
| commit | 4a01a38466a452c65f124577bcc21af386317bb8 (patch) | |
| tree | 821474e08366f40b3ff2e4fadb77d7f7bad3dfd3 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 1d67eba6873b1d551a259a0bbc1e2651b4443e12 (diff) | |
| parent | 4ceca095869244ef3026fd90e2c5e10216be3fe7 (diff) | |
| download | rust-4a01a38466a452c65f124577bcc21af386317bb8.tar.gz rust-4a01a38466a452c65f124577bcc21af386317bb8.zip | |
Rollup merge of #111087 - ibraheemdev:patch-15, r=dtolnay
Implement `Sync` for `mpsc::Sender` `mpsc::Sender` is currently `!Sync` because the previous implementation contained an optimization where the channel started out as single-producer and was dynamically upgraded on the first clone, which relied on a unique reference to the sender. This optimization is one of the main reasons the old implementation was so complex and was removed in #93563. `mpsc::Sender` can now soundly implement `Sync`. Note for any potential confusion, this chance does *not* add MPMC behavior. This only affects the already `Send + Clone` *sender*, not *receiver*. It's technically possible to rely on the `!Sync` behavior in the same way as a `PhantomData<*mut T>`, but that seems very unlikely in practice. Either way, this change is insta-stable and needs an FCP. `@rustbot` label +T-libs-api -T-libs
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
