Open
Description
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:
impl<A> Foo for Bar<A> {
fn method(&self) { }
}
where method
has the type FnDef(X, [_])
we will generate a program clause like
forall<A> {
NormalizeFn(<Foo as Bar<A>>::method => FnDef(X, [A]))
}
Rust-analyzer can then do a query like NormalizeFn(<Foo as Bar<u32>>::method => ?X)
to find the FnDef
type for the method that will run (which includes its unique id and the values of all its relevant type parameters).
Metadata
Metadata
Assignees
Labels
No labels