diff --git a/src/librustc/dep_graph/thread.rs b/src/librustc/dep_graph/thread.rs index 5b0e4a909c8..b15e0e33b84 100644 --- a/src/librustc/dep_graph/thread.rs +++ b/src/librustc/dep_graph/thread.rs @@ -176,6 +176,9 @@ pub fn main(swap_in: Receiver>, DepMessage::Query => query_out.send(edges.query()).unwrap(), } } - swap_out.send(messages).unwrap(); + if let Err(_) = swap_out.send(messages) { + // the receiver must have been dropped already + break; + } } }