Skip to content

Conversation

zetanumbers
Copy link
Contributor

@zetanumbers zetanumbers commented Aug 26, 2025

Fixes #142949

Explanation: #142949 (comment)

@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@WaffleLapkin
Copy link
Member

r? WaffleLapkin
@bors r+

@bors
Copy link
Collaborator

bors commented Aug 26, 2025

📌 Commit 82cc0ee has been approved by WaffleLapkin

It is now in the queue for this repository.

@rustbot rustbot assigned WaffleLapkin and unassigned petrochenkov Aug 26, 2025
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2025
Comment on lines +1962 to +1963
pub codegen_worker_receive: Receiver<CguMessage>,
pub shared_emitter_main: SharedEmitterMain,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment saying the field order is intentional would be helpful for future readers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually implementing Drop is also common when a specific drop order is required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe wrap intended fields in some comment block? This way new added fields to this struct didn't mix up with this description. Or maybe better impl drop for OngoingCodegen to enforce drop order, instead of comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klensy I think the current state is alright, but feel free to open a follow-up to make things nicer

Copy link
Contributor Author

@zetanumbers zetanumbers Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually implementing Drop is also common when a specific drop order is required.

I think better place for moved fields then would be inside of Coordinator. Idk, maybe i should do that instead? That would probably be more manageable.

@WaffleLapkin
Copy link
Member

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 26, 2025
@zetanumbers
Copy link
Contributor Author

zetanumbers commented Aug 27, 2025

Alright, I have reproduced the issue and confirmed my hypothesis. This PR should fix it.

@WaffleLapkin
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 27, 2025

📌 Commit dd07459 has been approved by WaffleLapkin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 27, 2025
bors added a commit that referenced this pull request Aug 28, 2025
Rollup of 5 pull requests

Successful merges:

 - #145382 (Add assembly test for `-Zreg-struct-return` option)
 - #145746 (Fix STD build failing for target_os = "espidf")
 - #145826 (Use AcceptContext in AttribueParser::check_target)
 - #145894 (Ensure the coordinator thread terminates before its channels drop)
 - #145946 (Remove unnecessary `[dependencies.unicode-properties]` entries.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5527156 into rust-lang:master Aug 28, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 28, 2025
rust-timer added a commit that referenced this pull request Aug 28, 2025
Rollup merge of #145894 - zetanumbers:issue-142949, r=WaffleLapkin

Ensure the coordinator thread terminates before its channels drop

Fixes #142949

Explanation: #142949 (comment)
@zetanumbers zetanumbers deleted the issue-142949 branch August 28, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: Could not send CguMessage to main thread
8 participants