Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix query cycle in needs drop code. #92804

Closed
wants to merge 1 commit into from

Conversation

JakobDegen
Copy link
Contributor

Closes #92725 .

In #90845, an optimization was introduced in the needs drop code to ensure that we recurse through the query system, thereby improving caching and not duplicating work. However, this optimization did not correctly check for possible cycles in doing this. This change introduces that check.

(the diff looks much bigger than it actually is thanks to indentation)

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 12, 2022
@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 12, 2022
In a previous PR, an optimization was introduced in the needs drop code to ensure that we recurse
through the query system, thereby improving caching and not duplicting work. However, this
optimization did not correctly check for possible cycles in doing this. This change introduces that
check.
@michaelwoerister
Copy link
Member

Thanks for the PR, @JakobDegen!

Looks good to me from a query system POV -- but I don't know too much about needs_drop.

Since @cjgillot assigned themselves to this PR too, I'll let them take another look.

@michaelwoerister michaelwoerister removed their assignment Jan 14, 2022
@cjgillot
Copy link
Contributor

I was interested in the query system POV too.

I'm not familiar enough with this code to understand how this patch avoids the query cycle, and how it articulates with the check in queue_type. @JakobDegen could you comment a bit more on how this works?

r? @Mark-Simulacrum since you reviewed #90845

@JakobDegen JakobDegen marked this pull request as draft January 17, 2022 00:52
@JakobDegen
Copy link
Contributor Author

This fix does not cover all the cases, I've started a zulip thread

@cjgillot cjgillot self-assigned this Jan 17, 2022
@Mark-Simulacrum Mark-Simulacrum removed their assignment Jan 17, 2022
@JakobDegen
Copy link
Contributor Author

Closing in favor of #93449 .

@JakobDegen JakobDegen closed this Jan 29, 2022
@JakobDegen JakobDegen deleted the fix-hasdrop-cycle branch March 5, 2022 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

error[E0391] cycle detected when computing when using rust_2021_incompatible_closure_captures
6 participants