about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAidan Hobson Sayers <aidanhs@cantab.net>2017-10-04 12:45:14 +0100
committerAidan Hobson Sayers <aidanhs@cantab.net>2017-10-04 12:46:43 +0100
commit4a6ede78eebb247f8f4bd60f422f652a1f9afeb6 (patch)
tree8e26883758273eec6ef065d0d6adc5819321c602 /src
parent9ae6ed78acf9dc865e2300a7db556389eed9692d (diff)
downloadrust-4a6ede78eebb247f8f4bd60f422f652a1f9afeb6.tar.gz
rust-4a6ede78eebb247f8f4bd60f422f652a1f9afeb6.zip
Don't unwrap work item results as the panic trace is useless
Fixes #43402 now there's no multithreaded panic printouts

Also update a comment
Diffstat (limited to 'src')
-rw-r--r--src/librustc_trans/back/write.rs19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs
index c39bdcf25cd..7ddcf23a85a 100644
--- a/src/librustc_trans/back/write.rs
+++ b/src/librustc_trans/back/write.rs
@@ -1638,9 +1638,9 @@ fn start_executing_work(tcx: TyCtxt,
                     needs_lto.push(result);
                 }
                 Message::Done { result: Err(()), worker_id: _ } => {
-                    shared_emitter.fatal("aborting due to worker thread panic");
+                    shared_emitter.fatal("aborting due to worker thread failure");
                     // Exit the coordinator thread
-                    panic!("aborting due to worker thread panic")
+                    panic!("aborting due to worker thread failure")
                 }
                 Message::TranslateItem => {
                     bug!("the coordinator should not receive translation requests")
@@ -1741,23 +1741,16 @@ fn spawn_work(cgcx: CodegenContext, work: WorkItem) {
         // Execute the work itself, and if it finishes successfully then flag
         // ourselves as a success as well.
         //
-        // Note that we ignore the result coming out of `execute_work_item`
-        // which will tell us if the worker failed with a `FatalError`. If that
-        // has happened, however, then a diagnostic was sent off to the main
-        // thread, along with an `AbortIfErrors` message. In that case the main
-        // thread is already exiting anyway most likely.
-        //
-        // In any case, there's no need for us to take further action here, so
-        // we just ignore the result and then send off our message saying that
-        // we're done, which if `execute_work_item` failed is unlikely to be
-        // seen by the main thread, but hey we might as well try anyway.
+        // Note that we ignore any `FatalError` coming out of `execute_work_item`,
+        // as a diagnostic was already sent off to the main thread - just
+        // surface that there was an error in this worker.
         bomb.result = {
             let _timing_guard = cgcx.time_graph.as_ref().map(|tg| {
                 tg.start(time_graph::TimelineId(cgcx.worker),
                          LLVM_WORK_PACKAGE_KIND,
                          &work.name())
             });
-            Some(execute_work_item(&cgcx, work).unwrap())
+            execute_work_item(&cgcx, work).ok()
         };
     });
 }