Skip to content

Refactor query latch#155881

Open
zetanumbers wants to merge 1 commit intorust-lang:mainfrom
zetanumbers:refactor-query-latch
Open

Refactor query latch#155881
zetanumbers wants to merge 1 commit intorust-lang:mainfrom
zetanumbers:refactor-query-latch

Conversation

@zetanumbers
Copy link
Copy Markdown
Contributor

@zetanumbers zetanumbers commented Apr 27, 2026

This PR removes unnecessary mutex for cycle errors. This is revival of #153779. Previously we could have to stored a cycle error per each query waiter in the cycle thus requiring a mutex for cycle error in each query waiter. However as #154973 has been merged query cycles break only on a single query so that QueryLatch can contain a single Option<Cycle> field.

r? @nnethercote

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Apr 27, 2026
@zetanumbers
Copy link
Copy Markdown
Contributor Author

cc @Zoxc

Removed unnecessary mutex for cycle errors
@zetanumbers zetanumbers force-pushed the refactor-query-latch branch from 5f18255 to 2e842f1 Compare April 28, 2026 11:48
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 28, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@nnethercote
Copy link
Copy Markdown
Contributor

Seems ok to me, though I don't understand this code well.

@Zoxc: any concerns before I approve it?

@Zoxc
Copy link
Copy Markdown
Contributor

Zoxc commented Apr 29, 2026

The cycle is associated with the waiter (it's given to the waiting thread), not really the latch itself, so I'd like to avoid this change unless needed. I'd consider it alongside #155927 given that it appears to be blocking on this.

@zetanumbers
Copy link
Copy Markdown
Contributor Author

zetanumbers commented Apr 29, 2026

Youre telling me I should close this? Or what should I do?

@nnethercote
Copy link
Copy Markdown
Contributor

The cycle is associated with the waiter (it's given to the waiting thread), not really the latch itself, so I'd like to avoid this change unless needed. I'd consider it alongside #155927 given that it appears to be blocking on this.

@Zoxc: can you expand on your comment? #155927 is marked as blocking on this PR, and I'm uncertain about the exact relationship between the two PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants