Skip to content

Commit 5527156

Browse files
authored
Rollup merge of #145894 - zetanumbers:issue-142949, r=WaffleLapkin
Ensure the coordinator thread terminates before its channels drop Fixes #142949 Explanation: #142949 (comment)
2 parents 64d0d1d + dd07459 commit 5527156

File tree

1 file changed

+5
-2
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+5
-2
lines changed

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,10 +1957,13 @@ impl<B: ExtraBackendMethods> Drop for Coordinator<B> {
19571957
pub struct OngoingCodegen<B: ExtraBackendMethods> {
19581958
pub backend: B,
19591959
pub crate_info: CrateInfo,
1960-
pub codegen_worker_receive: Receiver<CguMessage>,
1961-
pub shared_emitter_main: SharedEmitterMain,
19621960
pub output_filenames: Arc<OutputFilenames>,
1961+
// Field order below is intended to terminate the coordinator thread before two fields below
1962+
// drop and prematurely close channels used by coordinator thread. See `Coordinator`'s
1963+
// `Drop` implementation for more info.
19631964
pub coordinator: Coordinator<B>,
1965+
pub codegen_worker_receive: Receiver<CguMessage>,
1966+
pub shared_emitter_main: SharedEmitterMain,
19641967
}
19651968

19661969
impl<B: ExtraBackendMethods> OngoingCodegen<B> {

0 commit comments

Comments
 (0)