-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
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
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 |
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 |
this adds a test asserting *incorrect* behavior that can be seen in <rust-lang#18083>, and a test asserting the *correct* behavior for the case of no super traits.
this adds a test asserting *incorrect* behavior that can be seen in <rust-lang/rust-analyzer#18083>, and a test asserting the *correct* behavior for the case of no super traits.
Miri also hits this incorrect diagnostics, in this line.
Originally posted by @RalfJung in #18047 (comment)
The text was updated successfully, but these errors were encountered: