Skip to content

Commit 586d028

Browse files
Rollup merge of #88612 - lovasoa:patch-1, r=m-ou-se
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
2 parents 2b862be + 598e5b2 commit 586d028

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ 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!(
252+
self.to_wake.load(Ordering::SeqCst),
253+
0,
254+
"This is a known bug in the Rust standard library. See https://github.com/rust-lang/rust/issues/39364"
255+
);
252256
let ptr = token.cast_to_usize();
253257
self.to_wake.store(ptr, Ordering::SeqCst);
254258

0 commit comments

Comments
 (0)