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

Trait upcasting is not implemented yet #18083

Open
ShoyuVanilla opened this issue Sep 9, 2024 · 2 comments
Open

Trait upcasting is not implemented yet #18083

ShoyuVanilla opened this issue Sep 9, 2024 · 2 comments
Assignees
Labels
A-chalk chalk related issue A-ty type system / type inference / traits / method resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug

Comments

@ShoyuVanilla
Copy link
Member

ShoyuVanilla commented Sep 9, 2024

Miri also hits this incorrect diagnostics, in this line.

Originally posted by @RalfJung in #18047 (comment)

@ShoyuVanilla ShoyuVanilla self-assigned this Sep 9, 2024
@ShoyuVanilla ShoyuVanilla added A-ty type system / type inference / traits / method resolution C-bug Category: bug labels Sep 9, 2024
@ShoyuVanilla ShoyuVanilla changed the title Trait upcasting is not implemented Trait upcasting is not implemented yet Sep 9, 2024
bors added a commit that referenced this issue 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
@Veykril
Copy link
Member

Veykril commented Dec 26, 2024

this is going to be stabilized soon rust-lang/rust#134367 and we trigger type mismatch diagnostics on it so we should do something about this, example tests to check against are here https://github.com/WaffleLapkin/rust/tree/trait_upcasting_as_a_treat/tests/ui/traits/trait-upcasting

@Veykril Veykril added the Broken Window Bugs / technical debt to be addressed immediately label Dec 26, 2024
@ChayimFriedman2
Copy link
Contributor

ChayimFriedman2 commented Dec 26, 2024

I believe this needs to be fixed in Chalk, but I will check to be sure.

Edit: Yes, this needs to be fixed in the builtin Unsize impls, aka. here.

@ChayimFriedman2 ChayimFriedman2 added the A-chalk chalk related issue label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-chalk chalk related issue A-ty type system / type inference / traits / method resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants