Skip to content

Add more robust handling of nested query cycles#154389

Draft
Zoxc wants to merge 2 commits intorust-lang:mainfrom
Zoxc:nested-cycles
Draft

Add more robust handling of nested query cycles#154389
Zoxc wants to merge 2 commits intorust-lang:mainfrom
Zoxc:nested-cycles

Conversation

@Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Mar 25, 2026

This adds more robust handling of query cycle that occur while we are already printing a query cycle error. Such nested query cycle are compiler bugs and this adds special handling so that both the nested query cycle and the outer query cycle are printed. Doubly nested query cycle errors are ignored to prevent infinite recursion.

This is based on #153999

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 25, 2026
@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 25, 2026

The nested query cycles are currently printed as errors as I don't think we have the mechanism to resume after emitting a bug.

This means we have 2 tests that are failing which were previously "undetected".

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-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

2 participants