-
Notifications
You must be signed in to change notification settings - Fork 182
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
identifying which method will run for a trait #716
Comments
Implementation steps:
Extend the chalk-ir
Extend the database types
Actually, I think we have function signature and other information already accessible for Extend the program clause generationThe Extend the parser and unit testingWe ought to be able to write unit tests that include |
I am working on this on https://github.com/lf-/chalk/tree/source-impl (obviously it will be rebased and commits cleaned up when it's ready for proper review; I'm posting this for reference) So far done:
To do as I keep going:
Confused about: What to generate for program clauses for |
So that was a lie. It turns out the lowering and parsing contains way more lowering and parsing than I thought 😭. Moving slowly but getting places. Total diff has already crossed 1000 lines :V |
@rustbot release-assignment |
@jackh726, is this up for grabs? i would be interested in continuing the work in the linked PR. been looking for some chalk work. |
I think in theory yes. But this is more of a question for Niko. He said he has thoughts for a different approach :) |
@compiler-errors I'd be very psyched to see you continue with this work! I did have thoughts for another approach, but essentially what I wanted to do was to make "methods" kind of a special sort of associated type, I believe. We could schedule some time to talk about it at https://calendly.com/nikomatsakis/, @compiler-errors. |
I think it would be cool to treat associated types, consts, and methods similarly in how we resolve them (thinking with #745 in mind) |
As part of rust-lang/rust-analyzer#4558, we would like to extend chalk so that it can identify the fn that will run. The basic idea is to model this in a similar fashion to how associated type normalization works.
Summary of the idea
Given:
where
method
has the typeFnDef(X, [_])
we will generate a program clause likeRust-analyzer can then do a query like
NormalizeFn(<Foo as Bar<u32>>::method => ?X)
to find theFnDef
type for the method that will run (which includes its unique id and the values of all its relevant type parameters).The text was updated successfully, but these errors were encountered: