summaryrefslogtreecommitdiff
path: root/examples/recv_with_dropped_sender.rs
blob: f7a7171e1b883480a428fc7d734b3317fc59b70a (plain)
1
2
3
4
5
6
7
8
9
10
11
#[cfg(feature = "std")]
fn main() {
    let (sender, receiver) = oneshot::channel::<u128>();
    std::mem::drop(sender);
    receiver.recv().unwrap_err();
}

#[cfg(not(feature = "std"))]
fn main() {
    panic!("This example is only for when the \"sync\" feature is used");
}