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 projection substitution order considering GATs #790

Merged
merged 3 commits into from
Mar 12, 2023

Conversation

lowr
Copy link
Contributor

@lowr lowr commented Feb 16, 2023

When an AliasEq goal contains another alias as its self type, we generate the following clause: <<X as Y>::A as Z>::B == U :- <T as Z>::B == U, <X as Y>::A == T, with T being a new variable. We've been building <T as Z>::B by swapping the first argument in the original projection's substitution with T, but it's not the self type when the associated type B has generic parameters, leading to wrong subgoals.

The added test would yield "No possible solution" in current master.

Also removes ignore attribute on a doctest that was added in #778 as GATs hit stable.

Spotted in rust-lang/rust-analyzer#14164.

@jackh726
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 12, 2023

📌 Commit aa036e6 has been approved by jackh726

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 12, 2023

⌛ Testing commit aa036e6 with merge e7e15c3...

@bors
Copy link
Contributor

bors commented Mar 12, 2023

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing e7e15c3 to master...

@bors bors merged commit e7e15c3 into rust-lang:master Mar 12, 2023
bors added a commit to rust-lang/rust-analyzer that referenced this pull request Mar 19, 2023
internal: Bump chalk

This release fixes a problem around GATs (rust-lang/chalk#790). While a regression test is added in chalk's own test suite, I also added one in ours so that we can catch regressions when we move away from chalk.

Fixes #14164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants