about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOphir LOJKINE <pere.jobs@gmail.com>2021-09-03 12:14:55 +0200
committerGitHub <noreply@github.com>2021-09-03 12:14:55 +0200
commitaaa6de7905b4e5a9d194b8eb6810761861d4280a (patch)
treed238728cc064ebfd69d3afabe1ba13282615f4c4
parentfbdff7fae941bce21fd3047f87777c84b866850e (diff)
downloadrust-aaa6de7905b4e5a9d194b8eb6810761861d4280a.tar.gz
rust-aaa6de7905b4e5a9d194b8eb6810761861d4280a.zip
Add a better error message for #39364
There is a known bug in the implementation of mpsc channels in rust.
This adds a clearer error message when the bug occurs, so that developers don't lose too much time looking for the origin of the bug.
See https://github.com/rust-lang/rust/issues/39364
-rw-r--r--library/std/src/sync/mpsc/shared.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sync/mpsc/shared.rs b/library/std/src/sync/mpsc/shared.rs
index 0c32e636a56..d4ee1b414d9 100644
--- a/library/std/src/sync/mpsc/shared.rs
+++ b/library/std/src/sync/mpsc/shared.rs
@@ -248,7 +248,7 @@ impl<T> Packet<T> {
     // Returns true if blocking should proceed.
     fn decrement(&self, token: SignalToken) -> StartResult {
         unsafe {
-            assert_eq!(self.to_wake.load(Ordering::SeqCst), 0);
+            assert_eq!(self.to_wake.load(Ordering::SeqCst), 0, "This is a known bug in rust. See https://github.com/rust-lang/rust/issues/39364");
             let ptr = token.cast_to_usize();
             self.to_wake.store(ptr, Ordering::SeqCst);