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
Contributor

bors commented Jun 13, 2023

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

@lowr lowr force-pushed the feat/dyn-upcasting branch from ac1a0d7 to eb5f6be Compare June 13, 2023 17:32
@lowr lowr force-pushed the feat/dyn-upcasting branch from eb5f6be to a2aedf1 Compare June 13, 2023 17:34
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
lnicola pushed a commit to lnicola/rust that referenced this pull request Sep 25, 2024
…k, r=Veykril

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 rust-lang#18047 and rust-lang#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