Skip to content

Conversation

@Aditya-PS-05
Copy link
Contributor

@Aditya-PS-05 Aditya-PS-05 commented Nov 23, 2025

closes #21006

In commit 5038446, the query_with_diagnostics method was converted to a salsa tracked query but the cycle handler was not added during the conversion while other methods like type_for_type_alias_with_diagnostics, generic_predicates_for_param already have the cycle handlers.

So, I added a cycle handler for the query_with_diagnostics method.

And on testing, I found the issue was fixed.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 23, 2025
@ShoyuVanilla
Copy link
Member

Could you add a test for rust‑analyzer to address issue #21006?

Additionally, I suggest we investigate the root cause of the cycle reported in that issue:

  • Is the cycle itself expected but simply missing a cycle handler?
  • Or is the cycle unintended—meaning our lowering (or some other codes) is producing a cycle when it shouldn’t?

@Aditya-PS-05
Copy link
Contributor Author

Is the cycle itself expected but simply missing a cycle handler?

the cycle is expected as it arises from rust code patterns that rustc handles correctly.

Our lowering is correct but it just needs proper cycle handling like other queries.

@ShoyuVanilla
Copy link
Member

Which pattern? Could you point it out?

@Aditya-PS-05
Copy link
Contributor Author

Aditya-PS-05 commented Nov 24, 2025

pattern when a trait's where clause references a type alias that depends on trait itself by its type parameter.

@ShoyuVanilla
Copy link
Member

Well, your test passes even without the cycle handler

@Aditya-PS-05
Copy link
Contributor Author

Aditya-PS-05 commented Nov 24, 2025

Well, your test passes even without the cycle handler

I am having some difficulty to write a proper test. The test still passes. Can you suggest me some ways to do it?

@ChayimFriedman2
Copy link
Contributor

The best way is to start with the panicking code, and remove more and more code while keeping it panicking until you get the minimal snippet which still reproduces the problem.

However this query should never have a cycle (its parallels in rustc don't have either), and therefore the cycle means we're lowering things incorrectly. This fix is therefore also wrong.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cyclic dependency graph when parsing OPAQUE-KE v4.0.1

4 participants