about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/dep_graph/thread.rs5
1 files changed, 4 insertions, 1 deletions
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<Vec<DepMessage>>,
                 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;
+        }
     }
 }