Skip to content

Commit cacc31f

Browse files
async-llvm(26): Print error when failing to acquire Jobserver token.
1 parent a9a0ea9 commit cacc31f

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/librustc_trans/back/write.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,21 +1389,25 @@ fn start_executing_work(sess: &Session,
13891389
// this to spawn a new unit of work, or it may get dropped
13901390
// immediately if we have no more work to spawn.
13911391
Message::Token(token) => {
1392-
if let Ok(token) = token {
1393-
tokens.push(token);
1394-
1395-
if main_thread_worker_state == MainThreadWorkerState::LLVMing {
1396-
// If the main thread token is used for LLVM work
1397-
// at the moment, we turn that thread into a regular
1398-
// LLVM worker thread, so the main thread is free
1399-
// to react to translation demand.
1400-
main_thread_worker_state = MainThreadWorkerState::Idle;
1401-
running += 1;
1392+
match token {
1393+
Ok(token) => {
1394+
tokens.push(token);
1395+
1396+
if main_thread_worker_state == MainThreadWorkerState::LLVMing {
1397+
// If the main thread token is used for LLVM work
1398+
// at the moment, we turn that thread into a regular
1399+
// LLVM worker thread, so the main thread is free
1400+
// to react to translation demand.
1401+
main_thread_worker_state = MainThreadWorkerState::Idle;
1402+
running += 1;
1403+
}
1404+
}
1405+
Err(e) => {
1406+
let msg = &format!("failed to acquire jobserver token: {}", e);
1407+
shared_emitter.fatal(msg);
1408+
// Exit the coordinator thread
1409+
panic!()
14021410
}
1403-
} else {
1404-
shared_emitter.fatal("failed to acquire jobserver token");
1405-
// Exit the coordinator thread
1406-
panic!()
14071411
}
14081412
}
14091413

0 commit comments

Comments
 (0)