loom
loom copied to clipboard
Sending on closed channel causes "Messages leaked" error
#[test]
fn send_on_closed_channel() {
loom::model(|| {
let (sender, receiver) = loom::sync::mpsc::channel();
std::mem::drop(receiver);
sender.send(()).unwrap_err();
})
}
This simple test above fails with:
thread 'send_on_closed_channel' panicked at 'assertion failed: `(left == right)`
left: `0`,
right: `1`: Messages leaked', /.../loom/src/rt/mpsc.rs:142:9
Is this correct/intentional? There is no memory leak going on here, the value that fails to be sent is correctly dropped.
EDIT: This happens on 0.3.3 and latest version in git. I have not tried older versions.