From dd07459096beddf523b86a7ef03e4703390a7319 Mon Sep 17 00:00:00 2001 From: Daria Sukhonina Date: Tue, 26 Aug 2025 19:18:39 +0300 Subject: [PATCH] Comment on intentional field order --- compiler/rustc_codegen_ssa/src/back/write.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 0d766d2704ba..8586615f7c76 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -1958,6 +1958,9 @@ pub struct OngoingCodegen { pub backend: B, pub crate_info: CrateInfo, pub output_filenames: Arc, + // Field order below is intended to terminate the coordinator thread before two fields below + // drop and prematurely close channels used by coordinator thread. See `Coordinator`'s + // `Drop` implementation for more info. pub coordinator: Coordinator, pub codegen_worker_receive: Receiver, pub shared_emitter_main: SharedEmitterMain,