-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: type inference for generic associated types #13494
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
Conversation
|
I've run analysis-stats on self and std, confirmed it doesn't crash and the numbers don't change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, surprisingly few changes. Maybe we can simplify the lowering code in the future.
@bors d+
| let a = *p; | ||
| } | ||
| "#, | ||
| expect
This PR implements type inference for generic associated types. Basically, this PR lowers generic arguments for associated types in valid places and creates
Substitutions for them.I focused on the inference for correct Rust programs, so there are cases where we accidentally manage to infer things that are actually invalid (which would then be reported by flycheck so I deem them non-fatal). See the following tests and FIXME notes on them:
gats_with_dyn,gats_with_impl_trait.The added tests are rather arbitrary. Let me know if there are cases I'm missing or I should add.
Closes #9673