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

Support trait upcasting #796

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

lowr
Copy link
Contributor

@lowr lowr commented May 4, 2023

This PR implements RFC3324, dyn Trait upcasting (cc rust-lang/rust#65991).

As explained in the RFC, this PR adds builtin clauses for Unsize with applicability checks:

// when Trait2 is a super trait of Trait1 and AutoY is a subset of AutoX:
dyn Trait1 + AutoX + 'a: Unsize<dyn Trait2 + AutoY + 'b> :- EqGoal(...), 'a: 'b.

@jackh726
Copy link
Member

This one I'll have to get back to

@bors
Copy link
Collaborator

bors commented Jun 13, 2023

☔ The latest upstream changes (presumably #780) made this pull request unmergeable. Please resolve the merge conflicts.

bors added a commit to rust-lang/rust-analyzer that referenced this pull request Sep 11, 2024
Skip checks for cast to dyn traits

It seems that chalk fails to solve some obvious goals when there are some recursiveness in trait environments.
And it doesn't support trait upcasting yet. rust-lang/chalk#796

This PR just skips for casting into types containing `dyn Trait` to prevent false positive diagnostics like #18047 and #18083
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