in() {
    use std::sync::mpsc::channel;
    
    // The call to recv() will return an error because the channel has already
    // hung up (or been deallocated)
    let (tx, rx) = channel::&lt;i32&gt;();
    drop(tx);
    assert!(rx.recv().is_err());
    
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>sync</span>::<span class='ident'>mpsc</span>::<span class='ident'>channel</span>;

<span class='comment'>// The call to recv()