Skip to content

Commit aaa6de7

Browse files
authored
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 #39364
1 parent fbdff7f commit aaa6de7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sync/mpsc/shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl<T> Packet<T> {
248248
// Returns true if blocking should proceed.
249249
fn decrement(&self, token: SignalToken) -> StartResult {
250250
unsafe {
251-
assert_eq!(self.to_wake.load(Ordering::SeqCst), 0);
251+
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");
252252
let ptr = token.cast_to_usize();
253253
self.to_wake.store(ptr, Ordering::SeqCst);
254254

0 commit comments

Comments
 (0)